tutorials/frontendJS/respotify/webpack.config.js

46 lines
721 B
JavaScript
Raw Normal View History

2016-08-03 20:38:01 -04:00
const webpack = require('webpack');
const path = require('path');
const PATHS = {
app: './src/index.js',
html: './src/index.html',
dist: path.join(__dirname, 'dist')
};
module.exports = {
entry: {
javascript: PATHS.app,
html: PATHS.html
},
output: {
path: PATHS.dist,
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: PATHS.dist
},
2016-08-24 13:48:35 -04:00
eslint: {
emitWarning: true
},
2016-08-03 20:38:01 -04:00
module: {
2016-08-24 13:48:35 -04:00
preloaders: [
{
test: /\.js$/,
loaders: ['eslint-loader'],
exclude: /node_modules/
}
],
2016-08-03 20:38:01 -04:00
loaders: [
{
test: /\.html$/,
loader: "file?name=[name].[ext]"
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ["react-hot", "babel-loader"]
}
]
}
};