Skip to content

Instantly share code, notes, and snippets.

@a1exlism
Last active March 1, 2018 15:46
Show Gist options
  • Save a1exlism/a3f42ea9be87f31764b1826de1f3f505 to your computer and use it in GitHub Desktop.
Save a1exlism/a3f42ea9be87f31764b1826de1f3f505 to your computer and use it in GitHub Desktop.
/*
* Refer: @jantimon https://github.com/jantimon/html-webpack-plugin/issues/148
* Place javascript in a js folder
* Place css in a css folder
* Place html in the root folder
*/
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './example.js',
output: {
path: __dirname + '/dist',
publicPath: '',
filename: 'js/bundle.js'
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
}
]
},
plugins: [
new HtmlWebpackPlugin(),
new ExtractTextPlugin('css/styles.css')
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment