namesny-com/webpack.config.js

34 lines
948 B
JavaScript
Raw Normal View History

2017-04-07 19:57:56 +00:00
var HtmlWebpackPlugin = require('html-webpack-plugin');
var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: __dirname + '/src/index.html',
filename: 'index.html',
inject: 'body'
})
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname + '/dist',
filename: "index_bundle.js"
},
module: {
loaders: [
{test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
{test: /\.json$/, exclude: /node_modules/, loader: 'json-loader' },
{test: /\.(png|jpg)$/, exclude: /node_modules/, loader: 'url-loader'},
{test: /\.scss$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
}
]
},
plugins: [HtmlWebpackPluginConfig]
}