Newer
Older
const Webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
piotr.kupczyk@id.ethz.ch
committed
const CopyWebpackPlugin = require('copy-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',
piotr.kupczyk@id.ethz.ch
committed
port: 9999,
piotr.kupczyk@id.ethz.ch
committed
'/openbis': {
target: 'http://localhost:8888',
pathRewrite: { '^/openbis/resources': '/openbis-test/resources' },
changeOrigin: true,
secure: false
},
devMiddleware: {
piotr.kupczyk@id.ethz.ch
committed
publicPath: '/admin/'
piotr.kupczyk@id.ethz.ch
committed
static: [
{
directory: './src/resources',
publicPath: '/admin'
}
]
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: /\.(png|svg|jpg|jpeg|gif|ico)$/i,
piotr.kupczyk@id.ethz.ch
committed
type: 'asset'
},
{
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/')
},
fallback: {
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer')
piotr.kupczyk@id.ethz.ch
committed
}
},
plugins: [
new HtmlWebpackPlugin({
inject: 'body',
filename: './index.html',
template: './index.html'
}),
new Webpack.WatchIgnorePlugin({
paths: [new RegExp('/node_modules/'), new RegExp('/node/')]
}),
new Webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
piotr.kupczyk@id.ethz.ch
committed
}),
new Webpack.ProvidePlugin({
process: 'process/browser'