2016-09-15 21:53:29 +00:00
|
|
|
var webpack = require('webpack');
|
|
|
|
var path = require('path');
|
|
|
|
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
2016-09-16 21:04:43 +00:00
|
|
|
var HtmlWebpackPlugin = require("html-webpack-plugin");
|
2016-09-15 21:53:29 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2016-09-21 22:30:23 +00:00
|
|
|
devtool: 'cheap-eval-source-map',
|
2016-09-15 21:53:29 +00:00
|
|
|
entry: {
|
|
|
|
app: path.resolve(__dirname, '..', 'src', 'index.js'),
|
|
|
|
},
|
|
|
|
output: {
|
2016-09-19 21:16:33 +00:00
|
|
|
publicPath: '/',
|
2016-09-16 18:11:29 +00:00
|
|
|
path: path.resolve(__dirname, '../build'),
|
2016-09-15 21:53:29 +00:00
|
|
|
filename: '[name].dev.js',
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
src: path.resolve(__dirname, '..', 'src'),
|
|
|
|
shared: path.resolve(__dirname, '..', 'src', 'shared'),
|
|
|
|
style: path.resolve(__dirname, '..', 'src', 'style'),
|
|
|
|
utils: path.resolve(__dirname, '..', 'src', 'utils'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
preLoaders: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'eslint-loader',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
loaders: [
|
|
|
|
{
|
|
|
|
test: /\.json$/,
|
|
|
|
loader: 'json',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.scss$/,
|
|
|
|
//loader: 'style!css!sass',
|
|
|
|
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!sass-loader'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
|
|
|
loader : 'file-loader',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
loader: 'babel',
|
|
|
|
query: {
|
|
|
|
presets: ['es2015', 'react'],
|
|
|
|
cacheDirectory: true, // use a cache directory to speed up compilation
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
eslint: {
|
|
|
|
failOnWarning: false,
|
|
|
|
failOnError: false,
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
// Fixes annoying, unhelpful warnings in Electron,
|
|
|
|
// coming from reqwest's peer dependency on xhr2.
|
|
|
|
//
|
|
|
|
new webpack.IgnorePlugin(/xhr2/),
|
|
|
|
new ExtractTextPlugin("style.css"),
|
2016-09-16 22:16:48 +00:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: path.resolve(__dirname, '..', 'src', 'index.template.html'),
|
|
|
|
inject: 'body',
|
|
|
|
}),
|
2016-09-15 21:53:29 +00:00
|
|
|
],
|
|
|
|
postcss: require('./postcss'),
|
|
|
|
target: 'web',
|
|
|
|
};
|