Skip to content

Instantly share code, notes, and snippets.

@meze
Created February 19, 2016 13:41
Show Gist options
  • Save meze/c3eedc232ac2cda1c09c to your computer and use it in GitHub Desktop.
Save meze/c3eedc232ac2cda1c09c to your computer and use it in GitHub Desktop.
var path = require('path');
var webpack = require('webpack');
var project = require('../project.json');
var ROOT_PATH = path.resolve(__dirname);
module.exports = {
entry: path.resolve('admin', 'index.js'),
output: {
path: path.resolve(project.webroot),
filename: 'bundle.js',
publicPath: 'http://localhost:4000/'
},
resolve: {
extensions: ['', '.js'],
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015']
}
},
{
test: /\.less$/,
loaders: ["style", "css?root=../wwwroot", "less"]
},
{
test: /\.png$/, loader: "file-loader"
}
]
},
devtool: 'source-map',
devServer: {
host: "0.0.0.0",
port: "4000",
colors: true,
historyApiFallback: true,
hot: true,
inline: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment