Webpack Dev Server 2.1.0-beta.02 fails to load modules on second compilation -
i’m setting new project webpack2.1.0-beta.22
, web-pack-dev-server2.1.0-beta.2
.
now, i’ve set webpack build configs few times i’m not stranger process, seem have weird bug. when run webpack
straight up, app compiles 0 problems. but, when run webpack-dev-server
fails after first compilation (ie. after first source code change) complaining not being able find files.
error in ./~/css-loader!./~/postcss-loader!./src/app.css module build failed: (systemjs) enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader' error: enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader' @ error (native) error loading /users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader "./lib/loader" /users/jamie/skyrkt/bento-components/node_modules/css-loader/index.js @ ./src/app.css 4:14-116 @ ./src/index.js @ multi main
and error, depending on if update css or js.
error in ./src/index.js module build failed: (systemjs) enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/object-assign' error: enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/object-assign' @ error (native) error loading /users/jamie/skyrkt/bento-components/object-assign "object-assign" /users/jamie/skyrkt/bento-components/node_modules/babel-loader/index.js @ multi main
my whole webpack config follows:
const path = require('path'); const webpack = require('webpack'); const htmlwebpackplugin = require('html-webpack-plugin'); module.exports = { entry: { main: path.join(__dirname,'src/index.js') }, output: { path: path.join(__dirname,'dist'), filename: '[name].bundle.js' }, module: { loaders: [ { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.css$/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] }, { test: /\.(jpg|png|gif)$/, loader: 'file-loader' } ] }, plugins: [ new htmlwebpackplugin({ template: path.join(__dirname,'src/index.html') }) ], postcss: function(webpack) { // irrelevant postcss things. }, devserver: { port: '8080', host: 'localhost', inline: true, historyapifallback: true, watchoptions: { aggregatetimeout: 300, poll: 1000 }, outputpath: path.join(__dirname,'dist') } }
the command running is
webpack-dev-server --progress --profile --watch --content-base src/
it looks dev server thinks it’s running relative root or something? i’m not 100% sure.
does have ideas?
update can confirm not happen when using webpack@1.13.2
, webpack-dev-server@1.15.1
, instead of using import
in code, using require
.
thanks, jamie
Comments
Post a Comment