We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The extract-loader works great when I use the single entry syntax in my webpack configuration:
entry: [ './js/main.js', './scss/theme.scss' ]
But as soon as I change it to the object syntax as described in the documentation
entry: { main: './js/main.js', theme: './scss/theme.scss' }
hot reload doesn't work anymore.
It may be related to the fact that the generated file is theme.css instead of main.css ?
theme.css
main.css
I'm not using hashes and the <style> tag correctly points to the generated css file.
hashes
<style>
Here is my webpack configuration:
const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { entry: { main: './js/main.js', theme: './scss/theme.scss' }, output: { path: path.resolve(__dirname, './static'), publicPath: '/static/', filename: '[name].js' }, module: { rules: [ { test: /theme.scss$/, use: ['extracted-loader'].concat(ExtractTextPlugin.extract({use: ['css-loader', 'sass-loader']})), }, { test: /\.vue$/, loader: 'vue-loader', }, { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ } ] }, plugins: [ new ExtractTextPlugin({ filename: '[name].css', }), ], resolve: { alias: { 'vue$': 'vue/dist/vue.esm.js' }, extensions: ['*', '.js', '.vue', '.json'] }, externals: { jquery: 'jQuery', popper: 'Popper', bootstrap: 'jQuery' }, devServer: { historyApiFallback: true, noInfo: true, overlay: true, proxy: {"/": {target: "http://localhost:8000"}} }, performance: { hints: false }, devtool: '#eval-source-map' }; if (process.env.NODE_ENV === 'production') { module.exports.devtool = '#source-map'; // http://vue-loader.vuejs.org/en/workflow/production.html module.exports.plugins = (module.exports.plugins || []).concat([ new webpack.DefinePlugin({ 'process.env': { NODE_ENV: '"production"' } }), new webpack.optimize.UglifyJsPlugin({ sourceMap: true, compress: { warnings: false } }), new webpack.LoaderOptionsPlugin({ minimize: true }) ]) } else if (process.env.NODE_ENV === 'development') { module.exports.plugins = (module.exports.plugins || []).concat([ new webpack.NamedModulesPlugin() ]); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The extract-loader works great when I use the single entry syntax in my webpack configuration:
But as soon as I change it to the object syntax as described in the documentation
hot reload doesn't work anymore.
It may be related to the fact that the generated file is
theme.css
instead ofmain.css
?I'm not using
hashes
and the<style>
tag correctly points to the generated css file.Here is my webpack configuration:
The text was updated successfully, but these errors were encountered: