Created
October 2, 2017 18:04
-
-
Save doug2k1/5654a6801024ec01b7b3fa3ea929e9f3 to your computer and use it in GitHub Desktop.
Webpack multiple CSS entrypoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ExtractTextPlugin = require("extract-text-webpack-plugin") | |
const path = require('path') | |
module.exports = { | |
entry: { | |
main: './src/index.js', | |
base: './src/css/base.css', | |
admin: './src/css/admin.css' | |
}, | |
output: { | |
filename: 'bundle-[name].js', | |
path: path.resolve('dist') | |
}, | |
module: { | |
rules: [{ | |
test: /\.css$/, | |
use: ExtractTextPlugin.extract({ | |
use: "css-loader" | |
}) | |
}] | |
}, | |
plugins: [ | |
new ExtractTextPlugin('[name].css') | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment