Closed HIRANO-Satoshi closed 2 years ago
au
is not this aurelia-cli
(for Aurelia v1), it's an unreleased tool for Aurelia 2. For far as I know, there is no "au new" for Aurelia 2 yet.
For aurelia-cli, npm install -g aurelia-cli
, then do au new
.
mini-css-extract-plugin had a breaking change in v2.5.0, https://github.com/aurelia/v1/commit/caf5af7246296d9adfd04ff465eef49bba6f2559
They restored cjs behaviour in v2.5.1. I will revert previous change.
Fixed.
@3cp 3cp, thanks for quick fix.
The above "npm install -g au" should be "npm install -g aurelia-cli". Sorry for confusing.
I'm submitting a bug report
Please tell us about your environment:
Operating System: OSX 11.6.2
Node Version: v17.4.0 (latest)
NPM Version: 8.3.1 (latest)
Language: All
Loader/bundler: Webpack 5
Current behavior:
$ npm install -g aurelia-cli $ au new (choose default TypeScript App and yarn) $ npm start
aurelia-sample@0.1.0 start webpack server
[webpack-cli] TypeError: Cannot read properties of undefined (reading 'loader') at module.exports (/Users/s-hirano/dev/tmp/aurelia-sample/webpack.config.js:202:47) at loadConfigByPath (/Users/s-hirano/dev/tmp/aurelia-sample/node_modules/webpack-cli/lib/webpack-cli.js:1745:27) at async WebpackCLI.loadConfig (/Users/s-hirano/dev/tmp/aurelia-sample/node_modules/webpack-cli/lib/webpack-cli.js:1830:30) at async WebpackCLI.createCompiler (/Users/s-hirano/dev/tmp/aurelia-sample/node_modules/webpack-cli/lib/webpack-cli.js:2185:18) at async Command. (/Users/s-hirano/dev/tmp/aurelia-sample/node_modules/@webpack-cli/serve/lib/index.js:98:30)
at async Promise.all (index 1)
at async Command. (/Users/s-hirano/dev/tmp/aurelia-sample/node_modules/webpack-cli/lib/webpack-cli.js:1672:7)
webpack.config.js has the following line at line 4.
const MiniCssExtractPlugin = require('mini-css-extract-plugin').default;
Removing .default fixes.
const MiniCssExtractPlugin = require('mini-css-extract-plugin');