Releases: single-spa/create-single-spa
v1.18.0
Features
- Moving public path to a webpack plugin instead of set-public-path.js. You can remove the
set-public-path.js
file from existing projects. (#223) - Adding unsafe-eval to script-src CSP. (#224)
- Upgrade lib versions (#214)
Fixes
- fix(generator-single-spa): add missing dependency chalk and ejs (#220)
- Disable html generation for root configs. Resolves #222. (#227)
Maintenance
- Yarn.lock changes ece2ad2
v2.0.0-beta.1
Fixes
- Remove system parser false, as it's the new default in webpack 5. (#221)
v2.0.0-beta.0
Breaking changes
- webpack-config-single-spa now requires webpack@5, webpack-cli@4, and webpack-dev-server@4. This impacts utility modules, root configs, and react applications/parcels that were generated by create-single-spa. Vue, Angular, and Svelte applications are unaffected.
Migration from v1 to v2
Examples
- react-microfrontends/navbar#19
- react-microfrontends/api#10
- react-microfrontends/people#19
- react-microfrontends/root-config#21
- react-microfrontends/planets#17
Steps
- Upgrade webpack, webpack-dev-server, webpack-cli
npm install --save-dev webpack@latest webpack-dev-server@next webpack-cli@latest
- Find any dependencies in your package.json that start with
webpack-config-single-spa
orts-config-single-spa
. Upgrade them to the new version.
# DO NOT run all of these in your project. Only run the commands that apply to your project.
npm install --save-dev webpack-config-single-spa@latest
npm install --save-dev webpack-config-single-spa-ts@latest
npm install --save-dev webpack-config-single-spa-react@latest
npm install --save-dev webpack-config-single-spa-react-ts@latest
npm install --save-dev ts-config-single-spa@latest
-
Upgrade all webpack loaders and webpack plugins that are dependencies in your package.json. Loaders are dependencies whose names often end with
-loader
. Plugins are dependencies whose names often includewebpack-plugin
. -
Update your package.json
scripts
. All instances ofwebpack-dev-server
should be replaced withwebpack serve
. All instances of--env.thing
should be replaced with--env thing
. You can remove the=true
from any--env
parts of webpack commands, as webpack 5 defaults it to true without the=true
.
// Old
{
"scripts": {
"lint": "eslint src",
"start": "webpack-dev-server",
"test": "jest --passWithNoTests",
"build": "webpack --mode=production",
"analyze": "webpack --mode=production --env.analyze=true",
"format": "prettier --write './**'",
"watch-tests": "jest --watch",
"coverage": "jest --coverage --passWithNoTests"
}
}
// New
{
"scripts": {
"lint": "eslint src",
"start": "webpack serve",
"test": "jest --passWithNoTests",
"build": "webpack --mode=production",
"analyze": "webpack --mode=production --env analyze",
"format": "prettier --write .",
"watch-tests": "jest --watch",
"coverage": "jest --coverage --passWithNoTests"
}
}
- Test it out!
npm start
npm run build
npm run analyze
Stuck?
Post in #248, or post in the #general
channel in our slack workspace to ask questions.
v1.17.6
v1.17.5
Bad publish
This publish didn't work properly - please upgrade to 1.17.6
v1.17.4
v1.17.3
Fixes
For existing projects that are upgrading, you'll need to change your webpack config as shown in 1f55f48#diff-2988572da2719e208467808f0450220693dc5e4d409d27b932d6c137ac7ef0e6R4
v1.17.2
v1.17.1
v1.17.0
Features
- Adding standalone mode. More details at https://github.com/single-spa/standalone-single-spa-webpack-plugin