Newer
Older
const Webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
piotr.kupczyk@id.ethz.ch
committed
const path = require('path')
piotr.kupczyk@id.ethz.ch
committed
entry: './src/js/index.js',
output: {
path: __dirname + '/build/npm-build/',
filename: 'bundle.js'
},
piotr.kupczyk@id.ethz.ch
committed
host: '0.0.0.0',
inline: true,
piotr.kupczyk@id.ethz.ch
committed
contentBase: './src/js',
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
publicPath: '/ng-ui-path/',
piotr.kupczyk@id.ethz.ch
committed
'/openbis': {
target: 'http://localhost:8888',
pathRewrite: { '^/openbis/resources': '/openbis-test/resources' },
changeOrigin: true,
secure: false
}
piotr.kupczyk@id.ethz.ch
committed
devtool: 'source-map',
mode: 'development',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
piotr.kupczyk@id.ethz.ch
committed
use: ['style-loader', 'css-loader']
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000
}
}
]
},
piotr.kupczyk@id.ethz.ch
committed
resolve: {
alias: {
'@src': path.resolve(__dirname, 'src/'),
'@srcTest': path.resolve(__dirname, 'srcTest/'),
'@srcV3': path.resolve(__dirname, 'srcV3/')
}
},
plugins: [
new HtmlWebpackPlugin({
inject: 'body',
filename: './index.html',
template: './index.html'
}),
piotr.kupczyk@id.ethz.ch
committed
// new Webpack.WatchIgnorePlugin(['/home/vagrant/openbis/openbis_ng_ui/react/node_modules/', '/home/vagrant/openbis/openbis_ng_ui/react/node/'])
new Webpack.WatchIgnorePlugin([
new RegExp('/node_modules/'),
new RegExp('/node/')
])