update webpack.config for v2
This commit is contained in:
parent
dd0bb16e58
commit
d4afa34d48
1 changed files with 17 additions and 16 deletions
|
@ -16,8 +16,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
resolve: {
|
resolve: {
|
||||||
root: appPath,
|
modules: [appPath, "node_modules"],
|
||||||
extensions: ['', '.js', '.jsx', '.css'],
|
extensions: ['.js', '.jsx', '.css']
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
|
@ -25,28 +25,29 @@ module.exports = {
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
module: {
|
module: {
|
||||||
preLoaders: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
|
enforce: "pre",
|
||||||
loaders: ['eslint'],
|
loaders: ['eslint'],
|
||||||
// define an include so we check just the files we need
|
// define an include so we check just the files we need
|
||||||
include: PATHS.app
|
include: PATHS.app
|
||||||
}
|
},
|
||||||
],
|
{
|
||||||
loaders: [
|
test: /\.css$/,
|
||||||
{ test: /\.css$/, loader: "style!css" },
|
use: ["style-loader", "css-loader"]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
loader: 'babel',
|
exclude: /node_modules/,
|
||||||
query: {
|
use: {
|
||||||
cacheDirectory: true,
|
loader: 'babel-loader',
|
||||||
presets:[ 'es2015', 'react', 'stage-2' ]
|
options: {
|
||||||
|
cacheDirectory: true,
|
||||||
|
presets: [ 'es2015', 'react', 'stage-2' ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
{
|
|
||||||
test: /mime\.json$/,
|
|
||||||
loader: 'json',
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
target: 'electron-main',
|
target: 'electron-main',
|
||||||
|
|
Loading…
Reference in a new issue