Automatically run flow on build
This commit is contained in:
parent
a65e937623
commit
d1dd22eb5d
4 changed files with 32 additions and 8 deletions
|
|
@ -1,25 +1,34 @@
|
|||
// webpack.config.js:
|
||||
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const WebpackShellPlugin = require('webpack-shell-plugin');
|
||||
|
||||
const preBuildScripts = process.env.NO_FLOW == undefined ?
|
||||
process.env.FLOW_PATH != undefined ? [process.env.FLOW_PATH] : ['flow']
|
||||
: [];
|
||||
|
||||
module.exports = {
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx']
|
||||
},
|
||||
entry: [
|
||||
path.resolve(__dirname, 'src/index.jsx')
|
||||
path.resolve(__dirname, 'src/index.js')
|
||||
],
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'public/dist'),
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'main.js',
|
||||
publicPath: 'dist/'
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /\.css$/, loader: "style!css" },
|
||||
{ test: /\.(woff2?|eot|ttf|svg)$/, loader: "file-loader" },
|
||||
{ test: /\.css$/, loader: "style-loader!css-loader" },
|
||||
{ test: /\.js(x)?$/, exclude: /node_modules/, loader: "babel-loader" }
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new WebpackShellPlugin({onBuildStart:preBuildScripts})
|
||||
],
|
||||
devtool: 'source-map'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue