Created
May 16, 2017 15:59
-
-
Save ivportilla/2a87f0cd8ff44eeb563e0290cb3574b6 to your computer and use it in GitHub Desktop.
Webpack 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
const path = require('path'); | |
const webpack = require('webpack'); | |
const apiHost = require('./src/config/deploy.config'); | |
module.exports = { | |
entry: './src/frontend/app/index.js', | |
output: { | |
path: path.resolve(__dirname, './src/frontend/dist'), | |
filename: 'bundle.js' | |
}, | |
resolve: { | |
modules: [ | |
'node_modules' | |
] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|components)/, | |
loader: 'babel-loader', | |
query: { | |
presets: ["es2015"] | |
} | |
}, | |
{ test: /\.html$/, use: 'html-loader' } | |
] | |
}, | |
devServer: { | |
contentBase: path.join(__dirname, "src/frontend/dist"), | |
compress: true, | |
port: 9000, | |
historyApiFallback: true | |
}, | |
plugins: [ | |
new webpack.LoaderOptionsPlugin({ | |
minimize: true, | |
debug: false | |
}), | |
new webpack.optimize.UglifyJsPlugin(), | |
new webpack.DefinePlugin({ | |
__API__: apiHost | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment