-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
const FlowStatusWebpackPlugin = require('flow-status-webpack-plugin'); | ||
|
||
require('dotenv').config(); | ||
|
||
const config = { | ||
entry: ['./src/index.js'], | ||
output: { | ||
path: path.resolve('www/js/'), | ||
filename: 'bundle.js', | ||
}, | ||
module: { | ||
preLoaders: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'eslint-loader', | ||
exclude: /node_modules/, | ||
}, | ||
], | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel', | ||
exclude: /node_modules/, | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loaders: ['style', 'css?modules'], | ||
}, | ||
{ | ||
test: /\.json$/, | ||
loader: 'json', | ||
}, | ||
], | ||
}, | ||
eslint: { | ||
configFile: './.eslintrc.yaml', | ||
fix: true, | ||
}, | ||
plugins: [ | ||
new webpack.NoErrorsPlugin(), | ||
new FlowStatusWebpackPlugin({ | ||
binaryPath: './node_modules/.bin/flow', | ||
failOnError: true, | ||
}), | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify(process.env.NODE_ENV), | ||
}, | ||
}), | ||
], | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const merge = require('webpack-merge'); | ||
const path = require('path'); | ||
const WriteFilePlugin = require('write-file-webpack-plugin'); | ||
const baseConfig = require('./webpack.config.base.js'); | ||
|
||
const config = merge.smart(baseConfig, { | ||
devtool: 'inline-source-map', | ||
devServer: { | ||
outputPath: path.join(__dirname, './www/js'), | ||
contentBase: path.join(__dirname, './www'), | ||
port: 8090, | ||
host: '0.0.0.0', | ||
inline: true, | ||
}, | ||
plugins: [ | ||
new WriteFilePlugin(), | ||
], | ||
}); | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const path = require('path'); | ||
const merge = require('webpack-merge'); | ||
const baseConfig = require('./webpack.config.base.js'); | ||
|
||
const config = merge(baseConfig, { | ||
eslint: { | ||
configFile: './.eslintrc.yaml', | ||
fix: false, | ||
}, | ||
}); | ||
|
||
module.exports = config; |