webpack@2 #222

Merged
neb-b merged 3 commits from webpack-2 into master 2017-06-12 18:07:13 +02:00
2 changed files with 29 additions and 29 deletions
Showing only changes of commit 3a89a75e7d - Show all commits

View file

@ -1,23 +1,23 @@
const path = require('path');
const webpack = require('webpack')
const appPath = path.resolve(__dirname, 'js');
const path = require("path");
const webpack = require("webpack")
const appPath = path.resolve(__dirname, "js");
const PATHS = {
app: path.join(__dirname, 'app'),
dist: path.join(__dirname, 'dist')
app: path.join(__dirname, "app"),
dist: path.join(__dirname, "dist")
};
module.exports = {
entry: ['babel-polyfill', './js/main.js'],
entry: ["babel-polyfill", "./js/main.js"],
output: {
path: path.join(PATHS.dist, 'js'),
publicPath: '/js/',
path: path.join(PATHS.dist, "js"),
publicPath: "/js/",
filename: "bundle.js"
},
devtool: 'source-map',
devtool: "source-map",
resolve: {
modules: [appPath, "node_modules"],
extensions: ['.js', '.jsx', '.css']
extensions: [".js", ".jsx", ".css"]
},
plugins: [
new webpack.DefinePlugin({
@ -29,7 +29,7 @@ module.exports = {
{
test: /\.jsx?$/,
enforce: "pre",
loaders: ['eslint'],
loaders: ["eslint"],
// define an include so we check just the files we need
include: PATHS.app
},
@ -41,14 +41,14 @@ module.exports = {
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
loader: "babel-loader",
options: {
cacheDirectory: true,
presets: [ 'es2015', 'react', 'stage-2' ]
presets: [ "es2015", "react", "stage-2" ]
}
}
}
]
},
target: 'electron-main',
target: "electron-main",
};

View file

@ -1,27 +1,27 @@
const path = require('path');
const webpack = require('webpack')
const WebpackNotifierPlugin = require('webpack-notifier')
const path = require("path");
const webpack = require("webpack")
const WebpackNotifierPlugin = require("webpack-notifier")
const appPath = path.resolve(__dirname, 'js');
const appPath = path.resolve(__dirname, "js");
const PATHS = {
app: path.join(__dirname, 'app'),
dist: path.join(__dirname, '..', 'app', 'dist')
app: path.join(__dirname, "app"),
dist: path.join(__dirname, "..", "app", "dist")
};
module.exports = {
entry: ['babel-polyfill', './js/main.js'],
entry: ["babel-polyfill", "./js/main.js"],
output: {
path: path.join(PATHS.dist, 'js'),
publicPath: '/js/',
path: path.join(PATHS.dist, "js"),
publicPath: "/js/",
filename: "bundle.js",
pathinfo: true
},
cache: true,
devtool: 'eval',
devtool: "eval",
resolve: {
modules: [appPath, "node_modules"],
extensions: ['.js', '.jsx', '.css']
extensions: [".js", ".jsx", ".css"]
},
plugins: [
new WebpackNotifierPlugin(),
@ -37,7 +37,7 @@ module.exports = {
{
test: /\.jsx?$/,
enforce: "pre",
loaders: ['eslint'],
loaders: ["eslint"],
// define an include so we check just the files we need
include: PATHS.app
},
@ -49,14 +49,14 @@ module.exports = {
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
loader: "babel-loader",
options: {
cacheDirectory: true,
presets: [ 'es2015', 'react', 'stage-2' ]
presets: [ "es2015", "react", "stage-2" ]
}
}
}
]
},
target: 'electron-main',
target: "electron-main",
};