Skip to content
Snippets Groups Projects
webpack.config.dev.js 1.7 KiB
Newer Older
/* eslint-disable */
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  output: {
    path: __dirname + '/build/npm-build/',
    filename: 'bundle.js'
  },
  devServer: {
    https: false,
    watchOptions: {
      aggregateTimeout: 300,
      poll: 1000
    },
    proxy: {
      '/openbis': {
        target: 'http://localhost:8888',
        pathRewrite: { '^/openbis/resources': '/openbis-test/resources' },
        changeOrigin: true,
        secure: false

  mode: 'development',

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
      },
      {
        test: /\.(css)$/,
      },
      {
        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000
        }
      }
    ]
  },

  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'
    //    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/')
    ])