tutorials/frontendJS/respotify/webpack.config.js

46 lines
721 B
JavaScript

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
},
eslint: {
emitWarning: true
},
module: {
preloaders: [
{
test: /\.js$/,
loaders: ['eslint-loader'],
exclude: /node_modules/
}
],
loaders: [
{
test: /\.html$/,
loader: "file?name=[name].[ext]"
},
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ["react-hot", "babel-loader"]
}
]
}
};