Last active
March 1, 2018 15:46
-
-
Save a1exlism/a3f42ea9be87f31764b1826de1f3f505 to your computer and use it in GitHub Desktop.
And prob may come across: https://stackoverflow.com/questions/44439930/how-after-building-the-dist-folder-in-webpack-move-the-bundle-js-and-css-file-i
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
/* | |
* 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