Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
d0ce7f1
change initial commit message in changelogs (#3)
TomStrepsil Dec 24, 2024
27e436a
[#18] Fix JSDoc module names (#19)
TomStrepsil Jan 30, 2025
1f0cb29
[26] Fix public/scoped package publishing (#27)
TomStrepsil Mar 6, 2025
d85e398
fix registry url etc (#34)
TomStrepsil Mar 6, 2025
9c2e7b3
update pathSegmentToggleHandler to accept a Map
TomStrepsil Mar 16, 2025
a46f3d1
update join point generation, and add options to schema
TomStrepsil Mar 16, 2025
0705eee
generate join point refactor
TomStrepsil Mar 16, 2025
56a2638
default webpackMagicComment properly
TomStrepsil Mar 16, 2025
a663a39
update processVariantFiles
TomStrepsil Mar 17, 2025
027ad21
serve toggle handlers using Map
TomStrepsil Mar 17, 2025
e4a16a4
update logger for variants Map
TomStrepsil Mar 17, 2025
b47d992
fixup processVariantFiles
TomStrepsil Mar 17, 2025
a88b9f7
fixup processPointCuts
TomStrepsil Mar 17, 2025
c133b09
fixup fill optional default values
TomStrepsil Mar 17, 2025
9df38cc
fix typo
TomStrepsil Mar 17, 2025
35cb634
fixup schema?
TomStrepsil Mar 17, 2025
59eae9c
update JSDoc args for plugin
TomStrepsil Mar 17, 2025
47294cf
remove nonsense Vary header
TomStrepsil Mar 18, 2025
cd2fc82
Merge branch 'main' of github.com:TomStrepsil/web-toggle-point
TomStrepsil Apr 13, 2025
b22d7fc
package lock
TomStrepsil Apr 27, 2025
4b41c97
webpack loading schemes
TomStrepsil May 11, 2025
66657ba
make pack and unpack optional
TomStrepsil May 12, 2025
2d71b5a
remove needless guard revealed by coverage report
TomStrepsil May 12, 2025
63e38a0
react-pointcuts updates for load strategies
TomStrepsil May 15, 2025
d74cfaa
fixup adapterModuleSpecifier assertions to work on Windows filesystems
TomStrepsil May 15, 2025
f74ec9d
express example
TomStrepsil May 15, 2025
8ea8f9a
serve example update
TomStrepsil May 15, 2025
a6df6c8
remove comment
TomStrepsil May 15, 2025
2be8bab
add "toggled twice" example to "next"
TomStrepsil May 15, 2025
da8b418
add "content management" example to "next"
TomStrepsil May 15, 2025
be92095
fixup point cut config for "toggled twice" example
TomStrepsil May 15, 2025
7c3a28d
don't re-create the providerFactory in the experiments example
TomStrepsil May 15, 2025
4998279
add types for mdx and turndown
TomStrepsil May 15, 2025
a9c0d03
add readme for "content management" example, and colocate readme for …
TomStrepsil May 15, 2025
8406bd7
colocate pointCutConfigs for next examples
TomStrepsil May 15, 2025
f4f210a
changelog and locks etc.
TomStrepsil May 15, 2025
0439705
remove errant blank lines
TomStrepsil May 15, 2025
3ab4184
import/no-unresolved overrides due to eslint-plugin-import bug
TomStrepsil May 15, 2025
c09a0f4
update playwright
TomStrepsil May 15, 2025
484f758
Merge branch 'main' into feature/16-support-lazy-splits
TomStrepsil May 15, 2025
7eb708e
consistent full-stops
TomStrepsil May 15, 2025
d336661
remove errant comment
TomStrepsil May 15, 2025
8d3d095
fixup schema for loadStrategy
TomStrepsil May 15, 2025
04304b8
update changelog for root
TomStrepsil May 15, 2025
58cb9d4
fix interface definition for plugin
TomStrepsil May 15, 2025
716b160
WIP docs
TomStrepsil May 16, 2025
674b7d7
move to webpack-source-endorsed path separator regex
TomStrepsil May 17, 2025
f7f146a
fixup playwright headless weirdness
TomStrepsil May 17, 2025
b390d69
coverage
TomStrepsil May 17, 2025
f4785c0
update webpack docs
TomStrepsil May 17, 2025
3dccb66
readme formatting
TomStrepsil May 17, 2025
df99819
WIP
TomStrepsil May 17, 2025
9d3eabf
crossConnectJoinPoints -> linkJoinPoints
TomStrepsil May 17, 2025
61dfa95
webpack changelog
TomStrepsil May 17, 2025
dc9daec
changelog
TomStrepsil May 17, 2025
cf51821
express / next changelogs
TomStrepsil May 17, 2025
fa5fa8f
automation:ui
TomStrepsil May 17, 2025
8f016c9
CHANGELOGs, line endings
TomStrepsil May 18, 2025
2f226a0
ensure note renders properly
TomStrepsil May 18, 2025
0354eeb
point cuts docs
TomStrepsil May 18, 2025
872f301
jsdocs
TomStrepsil May 18, 2025
261ecf4
JSDoc
TomStrepsil May 18, 2025
d1d4ad2
fix link to module specifier documentation
TomStrepsil May 18, 2025
ec100f7
newline
TomStrepsil May 18, 2025
358397b
consistent return style
TomStrepsil May 18, 2025
e46f43e
build dependencies before unit testing
TomStrepsil May 18, 2025
fe148f1
fixup plugins hook factory for no plugins supplied
TomStrepsil May 19, 2025
a9fe749
win32 fixes
TomStrepsil May 19, 2025
bd25392
set serve example to es2022 output
TomStrepsil May 19, 2025
57bdc8a
update main readme for load strategies
TomStrepsil May 19, 2025
361e5b2
update eslint-plugin-workspaces
TomStrepsil May 19, 2025
c3eacd3
see if this'll make playwright windows happy...
TomStrepsil May 19, 2025
4920ba0
align package.json with changelogs, and better semver changes to exam…
TomStrepsil May 19, 2025
02266ae
consistent full stops in main readme
TomStrepsil May 19, 2025
056dcfd
ensure path exports are published
TomStrepsil May 20, 2025
04d88fb
update package.lock
TomStrepsil May 20, 2025
3b5373e
update express example to use module output
TomStrepsil May 21, 2025
6049f61
fixup for move to .mjs of express example
TomStrepsil May 21, 2025
4a966b0
remove errant type definition
TomStrepsil May 21, 2025
5c2b4cc
add missing changelog
TomStrepsil May 21, 2025
41857f3
update next note re: react-is binding for Next v14
TomStrepsil May 21, 2025
3683fb3
strictNullChecks for next example
TomStrepsil May 26, 2025
3109c81
note re: deferred require load strategy & next 14
TomStrepsil May 26, 2025
562726e
no content commit to kick off check runs after flaky automation run
TomStrepsil May 26, 2025
4c8a81b
put back weirdly missing README.mdx for content-management example
TomStrepsil May 26, 2025
6fbd508
remove alias variable & use null not undefined in mutable ref
TomStrepsil May 27, 2025
810ac80
add "features" missing from name of nodeRequestScopedFeaturesStoreFac…
TomStrepsil May 28, 2025
d20a886
Merge branch 'ASOS:main' into main
TomStrepsil Jul 14, 2025
710d357
Merge branch 'ASOS:main' into main
TomStrepsil Jul 14, 2025
f488cab
Merge branch 'ASOS:main' into main
TomStrepsil Jul 14, 2025
6d90bc3
Merge branch 'ASOS:main' into main
TomStrepsil Jul 14, 2025
4d7291a
Merge branch 'main' into feature/16-support-lazy-splits
TomStrepsil Jul 22, 2025
2e907c1
fixup registry
TomStrepsil Jul 22, 2025
c8adcfe
dedupe https
TomStrepsil Jul 22, 2025
ceec9dd
handle unresolvable files
TomStrepsil Jul 23, 2025
3506514
update changelog for resolved fix
TomStrepsil Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Test artifacts
coverage/

# Dependency directories
node_modules/

Expand Down
16 changes: 16 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ N.B. See changelogs for individual packages, where most change will occur:

This log covers the [monorepo](https://en.wikipedia.org/wiki/Monorepo).

## [0.10.7] - 2025-07-17

### Fixed

- remove `react` and `react-dom` from repo root package.json, introduced in [version 0.9.0](#090---2024-11-29)

### Added

- `test:unit:coverage` script

### Changed

- set minimum node version to 20.8 due to use of [`import.meta.resolve`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve) where possible in packages / examples
- updated to `0.11.0` of [`eslint-plugin-workspaces`](https://github.com/joshuajaco/eslint-plugin-workspaces) after [addition of ESLint9 support](https://github.com/joshuajaco/eslint-plugin-workspaces/commit/af855c3a3d8069366d4446747e91828ddf7560c6)
- update `eslint.config.mjs` to utilise flat config

## [0.10.6] - 2025-07-14

### Fixed
Expand Down
18 changes: 10 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,18 @@ The bare minimum would be injecting a plugin from the [`webpack package`](../pac

Then:

1. Figure out what code modules you'd like to toggle, and see if they are suitable
2. Figure out a filesystem convention to use
1. Figure out what code modules you'd like to toggle.
2. Figure out a filesystem convention to use.
- the default proposes colocating variations of base modules in `./__variants__/<feature name>/<variant name>/` folders, with filename parity for the modules themselves.
2. Implement the [`webpack package`](../packages/webpack/docs/README.md)[^2] into your build process, via configuration of appropriate [`pointcuts`](https://en.wikipedia.org/wiki/Pointcut), targeting code modules for toggling that meet the criteria:
- A single, default export, that is a function
- Side-effect free (or, at least, with harmless import side-effects)
- Resolvable by Webpack
3. Create a feature toggle state store, utilising the [`features package`](../packages/features/docs/README.md), or otherwise, suitable for the dynamism of your toggle type.
3. Figure out a ["loading strategy"](../packages/webpack/docs/README.md#loadstrategy) to use.
- the default loads modules at the point they are selected for use, and the code is build into the entry point of the application.
- static (loaded at the entrypoint to the bundle holding the code) or asynchronous (code split) strategies are also available, if compatible with the referring code
4. Implement the [`webpack package`](../packages/webpack/docs/README.md)[^2] into your build process, via configuration of appropriate [`pointcuts`](https://en.wikipedia.org/wiki/Pointcut), targeting code modules for toggling that meet the criteria:
- A single, default export, that is a function.
- Resolvable by Webpack.
5. Create a feature toggle state store, utilising the [`features package`](../packages/features/docs/README.md), or otherwise, suitable for the dynamism of your toggle type.
- This needs to get state from an appropriate Toggle Router / runtime state provider.
4. Create a toggle point for the point cuts
6. Create a toggle point for the point cuts.
- For a [React](https://react.dev/) application, the `withTogglePointFactory` or `withToggledHookFactory` from the [`react pointcuts package`](../packages/react-pointcuts/docs/README.md) can be used, to construct one.
- Again, use [the examples](../examples/README.md) as a guide.

Expand Down
10 changes: 2 additions & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@ import asosConfig from "./peripheral/eslint-config-asosconfig/index.js";
import globals from "globals";
import jsdoc from "eslint-plugin-jsdoc";
import markdown from "@eslint/markdown";
import { FlatCompat } from "@eslint/eslintrc";
import path from "path";
import { fileURLToPath } from "url";
import workspaces from "eslint-plugin-workspaces";

const scripts = ["*.{js,mjs}", "**/*.{js,mjs}"];
const markDowns = ["*.md", "**/*.md"];

const compat = new FlatCompat({
baseDirectory: path.dirname(fileURLToPath(import.meta.url))
});

export default [
...compat.extends("plugin:workspaces/recommended"),
workspaces.configs["flat/recommended"],
...asosConfig.map((config) => ({
files: scripts,
ignores: ["**/docs/**", "**/danger/**"],
Expand Down
18 changes: 18 additions & 0 deletions examples/express/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0] - 2025-05-17

### Changed

- added `source-map` devtool and `source-map-loader` to add in visualisation of the module structure in browser developer tools
- fixed to exact version of `react` in `dependencies`, and brought in version-linked `react-is`, a new required peer dependency of the `react-pointcuts` package
- updated the `config` example to utilise the `lazyComponentLoadStrategyFactory` from the `react-pointcuts` package
- updated the `animals` example to utilise the `staticLoadStrategyFactory` from the `webpack` package
- updated `webpack` to `5.99.7`
- update to support new object argument for toggle points introduced by updated webpack plugin
- `MiniCssExtractPlugin` moved to "common" setup block when configuring point cut
- updated to use [`output.module`](https://webpack.js.org/configuration/output/#outputmodule), to help demonstrate this compatibility
- updated [`webpack-node-externals`](https://www.npmjs.com/package/webpack-node-externals) to use `module` [`importType`](https://www.npmjs.com/package/webpack-node-externals#optionsimporttype-commonjs)

### Fixed

- removed "Vary" header from "animals" example, the page is meant to be un-cacheable, and the value was wrong in any case

## [0.2.5] - 2025-05-27

### Changed
Expand Down
18 changes: 10 additions & 8 deletions examples/express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-toggle-point-express-example",
"version": "0.2.5",
"version": "0.3.0",
"type": "module",
"engines": {
"node": ">=20.6.0"
Expand All @@ -10,25 +10,27 @@
"build-dependencies": "path-exists ../../packages/webpack/lib || npm run --prefix ../../packages/webpack build && path-exists ../../packages/ssr/lib || npm run --prefix ../../packages/ssr build && path-exists ../../packages/features/lib || npm run --prefix ../../packages/features build && path-exists ../../packages/react-pointcuts/lib || npm run --prefix ../../packages/react-pointcuts build",
"prebuild": "npm run build-dependencies",
"build": "webpack",
"start": "cross-env PORT=3002 node bin/server.cjs",
"start:small-env": "cross-env PORT=3003 node --env-file=./src/routes/config/.env-small bin/server.cjs",
"start:large-env": "cross-env PORT=3004 node --env-file=./src/routes/config/.env-large bin/server.cjs",
"start": "cross-env PORT=3002 node bin/server.mjs",
"start:small-env": "cross-env PORT=3003 node --env-file=./src/routes/config/.env-small bin/server.mjs",
"start:large-env": "cross-env PORT=3004 node --env-file=./src/routes/config/.env-large bin/server.mjs",
"prelint": "npm run build-dependencies",
"lint": "npm run lint:code && npm run lint:docs",
"lint:fix": "npm run lint:code -- --fix && npm run lint:docs -- --fix",
"lint:code": "eslint src --flag unstable_config_lookup_from_file",
"lint:docs": "eslint *.md --flag unstable_config_lookup_from_file"
},
"dependencies": {
"@asos/web-toggle-point-react-pointcuts": "file:../../packages/react-pointcuts",
"@asos/web-toggle-point-features": "file:../../packages/features",
"@asos/web-toggle-point-react-pointcuts": "file:../../packages/react-pointcuts",
"@asos/web-toggle-point-ssr": "file:../../packages/ssr",
"@asos/web-toggle-point-webpack": "file:../../packages/webpack",
"cross-env": "^7.0.3",
"express": "^4.17.1",
"http-status-codes": "^2.3.0",
"react": ">=17",
"react-dom": ">=17"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"source-map-loader": "^5.0.0"
},
"devDependencies": {
"babel-loader": "^9.2.1",
Expand All @@ -37,7 +39,7 @@
"path-exists-cli": "^2.0.0",
"prop-types": "^15.7.2",
"style-loader": "^4.0.0",
"webpack": "^5.38.1",
"webpack": "^5.99.7",
"webpack-cli": "^4.7.2",
"webpack-node-externals": "^3.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/express/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ app.get("/", (_, response) => {
</head>
<body>
<ul>
<li><a href="/animals">Version header with nodeRequestScoped store</a></li>
<li><a href="/animals">Version header with nodeRequestScoped features store</a></li>
<li><a href="/config">.env config with ssrBackedReactContext store for initial value in browser</a></li>
</ul>
</body>
Expand Down
6 changes: 5 additions & 1 deletion examples/express/src/routes/animals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ It also demonstrates the addition of a toggle-specific side-effect, resulting in

You should see a picture of a cat or a dog, depending on the version chosen. The contrived application uses a `streamImage` module that accesses a `urlFetcher`, which is varied by the toggle point.

The toggle point is a higher-order function to ensure that each invocation honours the toggle decision, based on current context. As a caveat of toggling, the constructor of the `urlFetcher` must be called on each request, rather than statically enacted at application start-up. The code demonstrates a mitigation of hypothetical cost of re-construction via use of a cache within the toggle point.
## Implementation

The variant module loading mode is configured as `static`, meaning all variations are added to the module instance cache when the application starts.

The toggle point is a higher-order function to ensure that each invocation honours the toggle decision, based on current context, forwarding on arguments to a class constructor. As a caveat of `static` toggling, the constructor of the `urlFetcher` must be called on each request, rather than statically enacted at application start-up. The code demonstrates a mitigation of hypothetical cost of re-construction via use of a cache within the toggle point.
The toggle point wraps the varied modules in a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy) to add the logging side-effect.

The use of [AsyncLocalStorage](https://nodejs.org/api/async_context.html#class-asynclocalstorage) allows the toggle decision to be scoped on a per-request basis, without explicit access to the express request context. The storage is initialised within [middleware](https://expressjs.com/en/resources/middleware.html).
2 changes: 1 addition & 1 deletion examples/express/src/routes/animals/featuresStore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nodeRequestScopedStoreFactory as featuresStoreFactory } from "@asos/web-toggle-point-features";
import { nodeRequestScopedFeaturesStoreFactory as featuresStoreFactory } from "@asos/web-toggle-point-features";

const featuresStore = featuresStoreFactory();

Expand Down
1 change: 0 additions & 1 deletion examples/express/src/routes/animals/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const contextMiddleware = (request, response, scopeCallBack) => {
response.status(StatusCodes.BAD_REQUEST).end();
return;
}
response.header("Vary", version);
featuresStore.useValue({ value: { version }, scopeCallBack });
};

Expand Down
2 changes: 1 addition & 1 deletion examples/express/src/routes/animals/togglePoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import featuresStore from "./featuresStore.js";

const cache = new WeakMap();

export default (_, featuresMap) => {
export default ({ featuresMap }) => {
return function (...args) {
const { default: Choice } = featuresMap.get(
`v${featuresStore.getFeatures().version}`
Expand Down
9 changes: 8 additions & 1 deletion examples/express/src/routes/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ It shows how a payload can be included in the props passed to the toggle point c

N.B. No implication that this is in any way a _good use_ of "config", it's heavily contrived.

The implementation uses the `lazyComponentLoadStrategyFactory` from the `react-pointcuts` package, to ensure that variant code is bundled independently, and downloaded on demand.

## Setup

1. `npm install`
2. `npm run start`
3. open `localhost:3002/config` in a browser, you should see a medium sized div
4. stop, and re-start the server with `npm run start:small-env` or `npm run start:large-env`
5. open `localhost:3003/config` (small env) or `localhost:3004/config` (large env), and see a different sized (and coloured) `div` shown
6. press the buttons, to demonstrate overriding the initial content serialized on the server.
6. press the buttons, to demonstrate overriding the initial content serialized on the server
- N.B. The colourisation is only a result of the stored config, so using the buttons will just change the size
- watch the network tab in developer tools to observe the lazy loading in effect
- try blocking one of the subsequent chunks, you should see the error boundary falling back to the default experience, with a console log:
```
ChunkLoadError: Variant errored, rendering fallback: Loading chunk ### failed.
```
2 changes: 1 addition & 1 deletion examples/express/src/routes/config/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ router.get("/*", (req, res) => {
</body>
</html>,
{
bootstrapScripts: ["/config/main.js"],
bootstrapModules: ["/config/main.mjs"],
onShellReady() {
res.statusCode = 200;
res.setHeader("Content-type", "text/html");
Expand Down
76 changes: 50 additions & 26 deletions examples/express/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,81 +1,105 @@
import { resolve, basename, dirname, posix } from "path";
import { fileURLToPath } from "url";
import externals from "webpack-node-externals";
import { TogglePointInjection } from "@asos/web-toggle-point-webpack/plugins";
import { TogglePointInjectionPlugin } from "@asos/web-toggle-point-webpack/plugins";
import MiniCssExtractPlugin from "mini-css-extract-plugin";
import { fileURLToPath } from "url";
import staticLoadStrategyFactory from "@asos/web-toggle-point-webpack/moduleLoadStrategyFactories/staticLoadStrategyFactory";
import lazyComponentLoadStrategyFactory from "@asos/web-toggle-point-react-pointcuts/lazyComponentLoadStrategyFactory";

const configPointCutConfig = {
name: "configuration variants",
variantGlobs: ["./src/routes/config/__variants__/*/*/*.jsx"],
togglePointModule: "/src/routes/config/togglePoint.js"
togglePointModuleSpecifier: "/src/routes/config/togglePoint.js",
loadStrategy: lazyComponentLoadStrategyFactory(),
};

const common = {
mode: "production",
devtool: "source-map",
experiments: {
outputModule: true,
},
output: {
module: true,
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
loader: "babel-loader",
},
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
}
]
}
use: [MiniCssExtractPlugin.loader, "css-loader"],
},
],
},
plugins: [new MiniCssExtractPlugin()],
};

const config = [
{
entry: "./src/index.js",
target: "node",
...common,
output: {
...common.output,
path: resolve(dirname(fileURLToPath(import.meta.url)), "bin"),
filename: "server.cjs",
filename: "server.mjs",
clean: true,
chunkFormat: "module"
},
externals: [externals()],
...common,
externals: [externals({ importType: "module" })],
plugins: [
new MiniCssExtractPlugin(),
new TogglePointInjection({
...common.plugins,
new TogglePointInjectionPlugin({
pointCuts: [
configPointCutConfig,
{
name: "animal apis by version",
variantGlobs: [
"./src/routes/animals/api/**/v{1..9}*([[:digit:]])/*.js"
"./src/routes/animals/api/**/v{1..9}*([[:digit:]])/*.js",
],
joinPointResolver: (variantPath) =>
posix.resolve(
variantPath,
...Array(3).fill(".."),
basename(variantPath)
),
togglePointModule: "/src/routes/animals/togglePoint.js"
}
]
})
]
togglePointModuleSpecifier: "/src/routes/animals/togglePoint.js",
loadStrategy: staticLoadStrategyFactory(),
},
],
}),
],
},
{
entry: "./src/routes/config/client.js",
target: "web",
...common,
output: {
...common.output,
path: resolve(dirname(fileURLToPath(import.meta.url)), "public"),
filename: "main.js"
filename: "main.mjs",
},
plugins: [
new MiniCssExtractPlugin(),
new TogglePointInjection({ pointCuts: [configPointCutConfig] })
...common.plugins,
new TogglePointInjectionPlugin({ pointCuts: [configPointCutConfig] }),
],
...common
}
module: {
...common.module,
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
...common.module.rules,
],
},
},
];

export default config;
Loading
Loading