diff --git a/landing/webpack.config.cjs b/landing/webpack.config.cjs index 5abbd01b6..33ad66f8c 100644 --- a/landing/webpack.config.cjs +++ b/landing/webpack.config.cjs @@ -1,80 +1,82 @@ const AssetsPlugin = require('assets-webpack-plugin'); const path = require('path'); const { createProdBrowserConfig, createDevBrowserConfig, createNodeServerRenderingConfig, } = require('lib/webpack/shared.cjs'); const babelConfig = require('./babel.config.cjs'); const baseBrowserConfig = { entry: { browser: ['./script.js'], }, output: { filename: 'prod.[hash:12].build.js', path: path.join(__dirname, 'dist'), }, resolve: { alias: { '../images': path.resolve('../keyserver/images'), }, }, }; const baseDevBrowserConfig = { ...baseBrowserConfig, output: { ...baseBrowserConfig.output, filename: 'dev.build.js', pathinfo: true, publicPath: 'http://localhost:8082/', }, devServer: { hot: true, port: 8082, contentBase: path.join(__dirname, 'dist'), headers: { 'Access-Control-Allow-Origin': '*' }, + allowedHosts: ['all'], + host: '0.0.0.0', }, }; const baseProdBrowserConfig = { ...baseBrowserConfig, plugins: [ new AssetsPlugin({ filename: 'assets.json', path: path.join(__dirname, 'dist'), }), ], }; const baseNodeServerRenderingConfig = { externals: ['react', 'react-dom', 'react-redux'], entry: { server: ['./landing-ssr.react.js'], }, output: { filename: 'landing.build.cjs', library: 'landing', libraryTarget: 'commonjs2', path: path.join(__dirname, 'dist'), }, }; module.exports = function (env) { const browserConfig = env === 'prod' ? createProdBrowserConfig(baseProdBrowserConfig, babelConfig) : createDevBrowserConfig(baseDevBrowserConfig, babelConfig); const nodeConfig = createNodeServerRenderingConfig( baseNodeServerRenderingConfig, babelConfig, ); const nodeServerRenderingConfig = { ...nodeConfig, mode: env === 'prod' ? 'production' : 'development', }; return [browserConfig, nodeServerRenderingConfig]; }; diff --git a/web/webpack.config.cjs b/web/webpack.config.cjs index 1ceb05bca..d17a12ea4 100644 --- a/web/webpack.config.cjs +++ b/web/webpack.config.cjs @@ -1,80 +1,82 @@ const AssetsPlugin = require('assets-webpack-plugin'); const path = require('path'); const { createProdBrowserConfig, createDevBrowserConfig, createNodeServerRenderingConfig, } = require('lib/webpack/shared.cjs'); const babelConfig = require('./babel.config.cjs'); const baseBrowserConfig = { entry: { browser: ['./script.js'], }, output: { filename: 'prod.[hash:12].build.js', path: path.join(__dirname, 'dist'), }, resolve: { alias: { '../images': path.resolve('../keyserver/images'), }, }, }; const baseDevBrowserConfig = { ...baseBrowserConfig, output: { ...baseBrowserConfig.output, filename: 'dev.build.js', pathinfo: true, publicPath: 'http://localhost:8080/', }, devServer: { hot: true, port: 8080, contentBase: path.join(__dirname, 'dist'), headers: { 'Access-Control-Allow-Origin': '*' }, + allowedHosts: ['all'], + host: '0.0.0.0', }, }; const baseProdBrowserConfig = { ...baseBrowserConfig, plugins: [ new AssetsPlugin({ filename: 'assets.json', path: path.join(__dirname, 'dist'), }), ], }; const baseNodeServerRenderingConfig = { externals: ['react', 'react-dom', 'react-redux'], entry: { keyserver: ['./app.react.js'], }, output: { filename: 'app.build.cjs', library: 'app', libraryTarget: 'commonjs2', path: path.join(__dirname, 'dist'), }, }; module.exports = function (env) { const browserConfig = env === 'prod' ? createProdBrowserConfig(baseProdBrowserConfig, babelConfig) : createDevBrowserConfig(baseDevBrowserConfig, babelConfig); const nodeConfig = createNodeServerRenderingConfig( baseNodeServerRenderingConfig, babelConfig, ); const nodeServerRenderingConfig = { ...nodeConfig, mode: env === 'prod' ? 'production' : 'development', }; return [browserConfig, nodeServerRenderingConfig]; };