Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const proxy = require('http-proxy-middleware');
const Webpack = require('webpack');
const { getDevServerConfig } = require('./helpers');
const baseConfig = require('./webpack.config.base');
const devHost = process.env.DEV_HOST
const target = getDevServerConfig();
const options = {
target: devHost || `http://${target.host}:${target.port}`, // target host
changeOrigin: true, // needed for virtual hosted sites
};
const apiProxy = proxy.createProxyMiddleware(options);
module.exports = merge(baseConfig, {
mode: 'development',
output: {
path: path.resolve(__dirname, '../../build2'),
filename: '[name].bundle.js',
},
optimization: {
noEmitOnErrors: true,
},
devServer: {
port: 4000,
historyApiFallback: true,
before: (app) => {
app.use('/control', apiProxy);
app.use(history({
rewrites: [
{
new webpack.ContextReplacementPlugin(/graphql-language-service-interface[\/\\]dist/, /\.js$/),
new MiniCssExtractPlugin({
filename: "style.[hash].css",
chunkFilename: "[id].css"
})
// new BundleAnalyzerPlugin({
// generateStatsFile: true,
// analyzerHost: "0.0.0.0",
// analyzerPort: 30088
// })
],
};
if (env === "skaffold" || !env) {
var dev = require("./webpack.config.dev");
return merge(common, dev);
} else {
var dist = require("./webpack.config.dist");
return merge(common, dist(env));
}
};
'webpack.config.renderer.dev.dll'
)
/**
* Warn if the DLL is not built
*/
if (!requiredByDLLConfig && !(fs.existsSync(dll) && fs.existsSync(manifest))) {
console.log(
chalk.black.bgYellow.bold(
'The DLL files are missing. Sit back while we build them for you with "yarn build-dll"'
)
)
execSync('yarn build-dll')
}
export default merge(baseConfig, {
devtool: 'inline-source-map',
mode: 'development',
target: 'electron-renderer',
entry: [
'core-js',
'regenerator-runtime/runtime',
...(process.env.PLAIN_HMR ? [] : ['react-hot-loader/patch']),
`webpack-dev-server/client?http://localhost:${port}/`,
'webpack/hot/only-dev-server',
require.resolve('../../RED/RED.tsx'),
],
output: {
const mergedConfig = (env, argv) => (
merge(terraWebpackConfig(env, argv), appWebpackConfig(env, argv))
);
'use strict';
process.env.NODE_ENV = 'production';
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const { merge } = require('webpack-merge');
const webpack = require('webpack');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
output: {
filename: '[name].[chunkhash].min.js',
path: path.join(__dirname, 'dist', 'prod'),
},
devtool: 'source-map',
plugins: [
new CleanWebpackPlugin(),
new OptimizeCSSAssetsPlugin(),
new MiniCssExtractPlugin({
filename: '[name].[chunkhash].min.css',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
}),
new webpack.HashedModuleIdsPlugin(),
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'development',
devtool: 'eval-source-map'
});
}),
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
map: {
inline: false,
annotation: true
}
}
}),
]
},
devtool: 'source-map',
};
module.exports = merge(baseConfig, devMode ? devConfig : prodConfig);
const { DefinePlugin } = require('webpack');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production'
});
module.exports = (env) => {
return merge(commonConfig(env), {
resolve: {
extensions: [".mjs", ".js", ".jsx"],
alias: {
pipe: path.resolve(env.bazelBinPath),
},
},
module: {
rules: [
{
type: "javascript/auto",
test: /\.m?js$/,
resolve: { fullySpecified: false },
use: [],
},
],
},
const TerserWebpackPlugin = require("terser-webpack-plugin");
const webpackMerge = require('webpack-merge');
const configBase = require('./webpack.config.js');
module.exports = webpackMerge.merge(configBase, {
output: {
publicPath: './',
},
mode: 'production',
devtool: false,
optimization: {
minimizer: [
new TerserWebpackPlugin()
]
},
});