Migrate webpack configuration to use ES2017.
This commit is contained in:
parent
0af2b0d050
commit
7111c504cc
|
@ -1,12 +1,12 @@
|
||||||
const path = require('path');
|
import path from 'path';
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
import ExtractTextPlugin from 'extract-text-webpack-plugin';
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||||
const webpack = require('webpack');
|
import webpack from 'webpack';
|
||||||
const MinifyPlugin = require("babel-minify-webpack-plugin");
|
import MinifyPlugin from 'babel-minify-webpack-plugin';
|
||||||
|
|
||||||
const ENV = process.env.NODE_ENV || 'development';
|
const ENV = process.env.NODE_ENV || 'development';
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
entry: ['babel-polyfill', './src/entry.js'],
|
entry: ['babel-polyfill', './src/entry.js'],
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'static', 'js'),
|
path: path.resolve(__dirname, 'static', 'js'),
|
||||||
|
@ -17,12 +17,12 @@ module.exports = {
|
||||||
|
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
enforce: "pre",
|
enforce: 'pre',
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: [
|
exclude: [
|
||||||
/node_modules/,
|
/node_modules/,
|
||||||
],
|
],
|
||||||
loader: "eslint-loader",
|
loader: 'eslint-loader',
|
||||||
options: {
|
options: {
|
||||||
emitWarning: true
|
emitWarning: true
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ module.exports = {
|
||||||
{
|
{
|
||||||
test: /\.js/,
|
test: /\.js/,
|
||||||
include: [
|
include: [
|
||||||
path.resolve(__dirname, "src"),
|
path.resolve(__dirname, 'src'),
|
||||||
],
|
],
|
||||||
exclude: [
|
exclude: [
|
||||||
/node_modules/,
|
/node_modules/,
|
||||||
|
@ -55,7 +55,7 @@ module.exports = {
|
||||||
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
||||||
// Limiting the size of the woff fonts breaks font-awesome ONLY for the extract text plugin
|
// Limiting the size of the woff fonts breaks font-awesome ONLY for the extract text plugin
|
||||||
// loader: "url?limit=10000"
|
// loader: "url?limit=10000"
|
||||||
use: "url-loader"
|
use: 'url-loader'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
|
test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
|
||||||
|
@ -69,12 +69,12 @@ module.exports = {
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: './',
|
contentBase: './',
|
||||||
historyApiFallback: true,
|
historyApiFallback: true,
|
||||||
host: "0.0.0.0",
|
host: '0.0.0.0',
|
||||||
hot: true,
|
hot: true,
|
||||||
port: 3000,
|
port: 3000,
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": "http://localhost:5000",
|
'/api': 'http://localhost:5000',
|
||||||
"/auth": "http://localhost:5000"
|
'/auth': 'http://localhost:5000'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue