如何通过 bootstrap-loader 配置 webpack 2.2.0 rc3 (rc4) 和 bootstrap alpha 6
How can I configure webpack 2.2.0 rc3 (rc4) and bootstrap alpha 6 via bootstrap-loader
如何使用 bootstap 4 显示正确的 webpack 2 rc3 配置?
这是我的.bootstraprc
毕竟我在 npm start 上遇到了这个错误:
Error in
./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":"/Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js
Module build failed: ModuleBuildError: Module build failed: TypeError:
Cannot read property 'path' of undefined @
./~/bootstrap-loader/lib/bootstrap.loader.js?extractStyles!./~/bootstrap-loader/no-op.js
1:21-1040 @ ./~/bootstrap-loader/extractStyles.js @ multi app
Error in
./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":"/Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js
Module build failed: ModuleBuildError: Module build failed: TypeError:
Cannot read property 'path' of undefined at Object.
(/Users/ivan/Dev/react/node_modules/async/dist/async.js:2234:31)
我已经解决了我的问题。
问题出在 webpack.config.js
情况如何:
new webpack.LoaderOptionsPlugin({
...
options: {
...
context: path.resolve(__dirname, '.'),
...
},
...
})
应该怎样
new webpack.LoaderOptionsPlugin({
...
options: {
...
context: path.resolve(__dirname, '.'),
output: {
path: 'dist',
},
...
},
...
})
如何使用 bootstap 4 显示正确的 webpack 2 rc3 配置?
这是我的.bootstraprc
毕竟我在 npm start 上遇到了这个错误:
Error in ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":"/Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'path' of undefined @ ./~/bootstrap-loader/lib/bootstrap.loader.js?extractStyles!./~/bootstrap-loader/no-op.js 1:21-1040 @ ./~/bootstrap-loader/extractStyles.js @ multi app
Error in ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader","css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","reboot","type","images","code","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","responsive-embed","close","badge","modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":"/Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js Module build failed: ModuleBuildError: Module build failed: TypeError: Cannot read property 'path' of undefined at Object. (/Users/ivan/Dev/react/node_modules/async/dist/async.js:2234:31)
我已经解决了我的问题。 问题出在 webpack.config.js
情况如何:
new webpack.LoaderOptionsPlugin({
...
options: {
...
context: path.resolve(__dirname, '.'),
...
},
...
})
应该怎样
new webpack.LoaderOptionsPlugin({
...
options: {
...
context: path.resolve(__dirname, '.'),
output: {
path: 'dist',
},
...
},
...
})