Skip to content
Snippets Groups Projects
webpack.config.dev.js 1.77 KiB
Newer Older
  • Learn to ignore specific revisions
  • /* eslint-disable */
    
    const HtmlWebpackPlugin = require('html-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
    
        },
        devMiddleware: {
          publicPath: '/ng-ui-path/'
        },
        static: {
          directory: './src/js'
    
    
      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/')
    
        },
        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'