Skip to content

Instantly share code, notes, and snippets.

@doug2k1
Created October 2, 2017 18:04
Show Gist options
  • Save doug2k1/5654a6801024ec01b7b3fa3ea929e9f3 to your computer and use it in GitHub Desktop.
Save doug2k1/5654a6801024ec01b7b3fa3ea929e9f3 to your computer and use it in GitHub Desktop.
Webpack multiple CSS entrypoints
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