const path = require('path') module.exports = { entry: 'index.js', entry: ['index1.js', 'index2.js'], entry: { a: 'indexA.js', b: ['indexB1.js', 'indexB2.js'] },
output: { path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js', filename: '[name].js', filename: '[chunkhash].js',
publicPath: '/public', publicPath: '', publicPath: 'https://cdn.jsdelivr.net/',
library: 'MyLibrary',
libraryTarget: 'umd',
pathinfo: true,
chunkFilename: '[id].js', chunkFilename: '[chunkhash].js',
jsonpFunction: 'webpackJsonp',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: 'webpack:///[resource-path]',
crossOriginLoading: 'use-credentials', crossOriginLoading: 'anonymous', crossOriginLoading: false, },
module: { rules: [ { test: /\.jsx?$/, include: [ path.resolve(__dirname, 'src'), ], exclude: [ /node_modules/ ], use: [ 'style-loader', { loader: 'css-loader', options: {} } ] } ], noParse: [ /special-library\.js$/ ] },
plugins: {},
resolve: { modules: [ 'node_modules', path.resolve(__dirname, 'src') ], extensions: ['.js', 'json', 'jsx', '.css'], alias: { '@': path.resolve(__dirname, 'src'), 'only-module$': 'new-module' }, alias: [ { name: 'module', alias: 'new-module', onlyModule: true } ], symlinks: true, descriptionFiles: ['package.json'], mainFields: ['main'], enforceExtension: false, },
performance: { hints: 'warning', maxAssetSize: 200000, maxEntrypointSize: 400000, assetFilter: function (assetFilename) { return assetFilename.endWith('.css') || assetFilename.endWith('.js') } },
devtool: 'source-map',
context: __dirname,
target: 'web', target: 'webworker', target: 'node', target: 'async-node', target: 'node-webkit', target: 'electron-main', target: 'electron-renderer',
externals: { jquery: 'jQuery' },
stats: { assets: true, colors: true, errors: true, errorDetails: true, hash: true, },
devServer: { proxy: { '/api': 'http://localhost:3000' }, contentBase: path.join(__dirname, 'public'), compress: true, historyApiFallback: true, hot: true, https: false, },
profile: true, cache: false,
watch: true, watchOptions: { ignored: /node_modules/,
aggregateTimeout: 300, poll: 1000 } }
|