Closed lutaev closed 8 years ago
Please try remove root=.
parameter for css-loader
.
https://github.com/webpack/css-loader#root-relative-urls
Unfortunately no, it didn't help. But I could solve it with alias in webpack config:
resolve: {
modulesDirectories: ['node_modules', 'bower_components', '../app'],
extensions: ['', '.jsx', '.js', '.json', '.scss', '.eot', '.ttf', '.svg', '.woff'],
alias:{
fonts: path.resolve(__dirname, 'node_modules', 'react-notifications', 'lib', 'fonts')
},
root: path.resolve('./app')
}
Hey I am getting the same error. I am not putting import 'react-notifications/lib/notifications.css'; in webpack I am putting it in index.js which is my entry point
my webpack.config.js is :-
module.exports = { entry: "./index.js", output: { path: '../resources/static/bundle', filename: "bundle.js" }, module: { loaders: [ { test: /\.css$/, loader: "style!css" }, { test: /\.scss$/, loader: 'style!' + 'css?sourceMap' + '!sass?sourceMap' }, { test: /\.(js|jsx)/, exclude: /node_modules/, loader: 'babel-loader', query: { presets:['es2015','react'] } } ] }, devtool: 'source-map' };
The problem: when I try to build app using webpack, I get an error:
ERROR in ./~/css-loader?root=.&sourceMap&modules&importLoaders=1&localIdentName=[local]_[hash:base64:5]!./~/postcss-loader?sourceMap!./~/sass-loader!./~/toolbox-loader!./~/react-notifications/lib/notifications.css Module not found: Error: Cannot resolve module 'fonts/notification.eot' in /Users/artyom/teambeat/ui/nodemodules/react-notifications/lib @ ./~/css-loader?root=.&sourceMap&modules&importLoaders=1&localIdentName=[local][hash:base64:5]!./~/postcss-loader?sourceMap!./~/sass-loader!./~/toolbox-loader!./~/react-notifications/lib/notifications.css 6:87-127
My webpack config:
May be, problem i in my config, but I looked in notification.css and I saw that if we change
to
everything is good.