Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg: Require webpack-cli v4 #51

Merged
merged 1 commit into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/linaria/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "webpack --mode=production",
"build:server": "webpack --mode=production --target=node",
"build:clean": "rm -rf dist",
"analyze": "webpack --mode=production --env.analyze",
"profile": "webpack --mode=production --env.profile",
"pkgcheck": "webpack --env.check=nobuild",
"analyze": "webpack --mode=production --env analyze",
"profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild",
"type-check": "tsc --noEmit",
"format": "eslint --fix \"src/**/*.{js,ts,tsx}\"",
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
Expand Down
6 changes: 3 additions & 3 deletions examples/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "webpack --mode=production",
"build:server": "webpack --mode=production --target=node",
"build:clean": "rm -rf dist",
"analyze": "webpack --mode=production --env.analyze",
"profile": "webpack --mode=production --env.profile",
"pkgcheck": "webpack --env.check=nobuild",
"analyze": "webpack --mode=production --env analyze",
"profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild",
"type-check": "tsc --noEmit",
"format": "eslint --fix \"src/**/*.{js,ts,tsx}\"",
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"lerna": "^3.22.1",
"typescript": "^4.0.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0"
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion packages/generator-js/src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class WebpackGenerator extends InstallPeersMixin(BetterGenerator) {
this.installPeers('@anansi/webpack-config', [], { dev: true });
const devDeps = [
'@anansi/webpack-config',
'webpack-cli@3',
'webpack-cli@4',
'webpack-dev-server@3',
];
if (this?.props?.style === 'linaria') {
Expand Down
6 changes: 3 additions & 3 deletions packages/generator-js/src/webpack/templates/package.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"start": "webpack-dev-server --mode=development",
"prod": "serve <%= assetPath %>",
"build": "webpack --mode=production",
"analyze": "webpack --mode=production --env.analyze",
"profile": "webpack --mode=production --env.profile",
"pkgcheck": "webpack --env.check=nobuild"
"analyze": "webpack --mode=production --env analyze",
"profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild"
}
}
14 changes: 7 additions & 7 deletions packages/webpack-config-anansi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ module.exports = makeConfig(options);
"start": "webpack-dev-server --mode=development",
"build": "webpack --mode=production",
"build:server": "webpack --mode=production --target=node",
"analyze": "webpack --mode=production --env.analyze",
"profile": "webpack --mode=production --env.profile",
"pkgcheck": "webpack --env.check=nobuild",
"analyze": "webpack --mode=production --env analyze",
"profile": "webpack --mode=production --env profile",
"pkgcheck": "webpack --env check=nobuild",
}
}
```
Expand Down Expand Up @@ -67,26 +67,26 @@ yarn add --dev react-refresh

If set, will build a static [treemap visualization of your packages](https://www.npmjs.com/package/webpack-bundle-analyzer). Highly recommended to run in production mode to get accurate results.

`webpack --mode=production --env.analyze`
`webpack --mode=production --env analyze`

### check

If set will run package checks to check for duplicates or ciruclar dependencies. Set equal to 'nobuild' for a standalone run where build output is not needed.

Examples:
`webpack --mode=production --env.check` or `webpack --env.check=nobuild`
`webpack --mode=production --env check` or `webpack --env check=nobuild`

### profile

If set, will enable [React DevTools Profiler](https://reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html). This feature is only available in production mode since it is enabled in development by default.

`webpack --mode=production --env.profile`
`webpack --mode=production --env profile`

### readable

Skips minification. This is useful when trying to debug production code.

`webpack --mode=production --env.readable`
`webpack --mode=production --env readable`

### target

Expand Down
6 changes: 5 additions & 1 deletion packages/webpack-config-anansi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
"@hot-loader/react-dom": "^16.0.0",
"@storybook/react": "^6.0.0",
"react-refresh": "^0.8.0",
"webpack": "^4.43.0 || ^5.0.0-beta.28"
"webpack": "^4.43.0 || ^5.0.0-beta.28",
"webpack-cli": "^4.1.0"
},
"peerDependenciesMeta": {
"react-refresh": {
Expand All @@ -106,6 +107,9 @@
},
"@storybook/react": {
"optional": true
},
"webpack-cli": {
"optional": true
}
}
}