mirror of
https://github.com/LukeHagar/firecamp.git
synced 2025-12-07 04:19:45 +00:00
chore: webpack config optimized
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
// imports environment
|
||||
require('dotenv').config();
|
||||
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
const BundleAnalyzerPlugin =
|
||||
require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
const { common, env, plugins, rules, output } = require('./webpack.config');
|
||||
|
||||
const base = require('./webpack.common');
|
||||
|
||||
const withReport = process.env.npm_config_withReport;
|
||||
|
||||
module.exports = {
|
||||
...common,
|
||||
module.exports = merge(base, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-cheap-module-source-map',
|
||||
devtool: 'cheap-module-source-map',
|
||||
output: { clean: true },
|
||||
devServer: {
|
||||
//server: 'https',
|
||||
static: path.join(__dirname, './build/development'),
|
||||
@@ -28,51 +28,9 @@ module.exports = {
|
||||
'X-Requested-With, content-type, Authorization',
|
||||
},
|
||||
},
|
||||
output,
|
||||
plugins: [
|
||||
...plugins,
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.IgnorePlugin({ resourceRegExp: /[^/]+\/[\S]+.dev$/ }),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
...env,
|
||||
FIRECAMP_EXTENSION_AGENT_ID: JSON.stringify(
|
||||
process.env.FIRECAMP_EXTENSION_AGENT_ID
|
||||
),
|
||||
},
|
||||
}),
|
||||
// new BundleAnalyzerPlugin(),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
...rules,
|
||||
{
|
||||
test: /\.(ts|js)x?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: [
|
||||
'@babel/preset-env',
|
||||
[
|
||||
'@babel/preset-react',
|
||||
{
|
||||
runtime: 'automatic',
|
||||
},
|
||||
],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
'@babel/plugin-transform-runtime',
|
||||
{
|
||||
regenerator: true,
|
||||
},
|
||||
],
|
||||
['@babel/plugin-proposal-export-default-from'],
|
||||
'add-module-exports',
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user