Releases: tommy351/kosko
Releases · tommy351/kosko
@kosko/migrate@2.0.1
@kosko/helm@0.1.1
@kosko/generate@1.2.0
@kosko/env@2.0.0
Major Changes
-
#73
b90c724
Thanks @tommy351! - Add support for browser. Several APIs were introduced in this release.Loader
interfacecreateEnvironment
functioncreateAsyncEnvironment
functioncreateNodeCJSEnvironment
functioncreateNodeESMEnvironment
functioncreateSyncEnvironment
functioncreateSyncLoaderReducers
functioncreateAsyncLoaderReducers
function
The following example shows how to use this package in browsers.
import env, { createLoaderReducers } from "@kosko/env"; env.setReducers(reducers => [ ...reducers, ...createAsyncLoaderReducers({ global: () => import("./environments/dev/index.js").then(mod => mod.default), component: name => import(`./environments/dev/${name}.js`).then(mod => mod.default) }) ]);
BREAKING CHANGES: The following APIs were changed in this release.
Environment
class →Environment
interfaceSyncEnvironment
class →createNodeCJSEnvironment
functionAsyncEnvironment
class →createNodeESMEnvironment
function
You don't have to change anything, unless you initialize these classes manually.
// Before const { Environment } = require("@kosko/env"); const env = new Environment(process.cwd()); // After const { createNodeCJSEnvironment } = require("@kosko/env"); const env = createNodeCJSEnvironment({ cwd: process.cwd() });