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

module.exports = {
  output: {
    path: __dirname + '/build/npm-build/',
    filename: 'bundle.js'
  },
  devServer: {
    https: false,
    proxy: {
      '/openbis': {
        target: 'http://localhost:8888',
        pathRewrite: { '^/openbis/resources': '/openbis-test/resources' },
        changeOrigin: true,
        secure: false
    static: [
      {
        directory: './src/resources',
        publicPath: '/admin'
      }
    ]

  mode: 'development',

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
      },
      {
        test: /\.(css)$/,
      {
        test: /\.(png|svg|jpg|jpeg|gif|ico)$/i,
      {
        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/')
    },
    fallback: {
      stream: require.resolve('stream-browserify'),
      buffer: require.resolve('buffer')
  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']
    }),
    new Webpack.ProvidePlugin({
      process: 'process/browser'