From 71677f70b186c8eb5160cdf322b9804448b33333 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 10 Aug 2021 14:12:06 -0700 Subject: [PATCH] chore: apps webpack config --- apps/toolbox/.gitignore | 1 + apps/toolbox/nativescript.config.ts | 5 +++-- apps/toolbox/webpack.custom.config.js | 18 ++++++++++++++++++ apps/ui/.gitignore | 1 + apps/ui/nativescript.config.ts | 5 +++-- apps/ui/webpack.custom.config.js | 18 ++++++++++++++++++ 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 apps/toolbox/webpack.custom.config.js create mode 100644 apps/ui/.gitignore create mode 100644 apps/ui/webpack.custom.config.js diff --git a/apps/toolbox/.gitignore b/apps/toolbox/.gitignore index 30a335727..b5d843b53 100644 --- a/apps/toolbox/.gitignore +++ b/apps/toolbox/.gitignore @@ -40,3 +40,4 @@ app/app.scss package-lock.json !tools/** +!webpack.custom.config.js diff --git a/apps/toolbox/nativescript.config.ts b/apps/toolbox/nativescript.config.ts index ebe1244f4..5b3e82b55 100644 --- a/apps/toolbox/nativescript.config.ts +++ b/apps/toolbox/nativescript.config.ts @@ -1,11 +1,12 @@ import { NativeScriptConfig } from '@nativescript/core'; export default { - id: 'org.nativescript.ToolBox', + id: 'org.nativescript.ToolBox', appResourcesPath: '../../tools/assets/App_Resources', + webpackConfigPath: 'webpack.custom.config.js', android: { v8Flags: '--expose_gc', markingMode: 'none', suppressCallJSMethodExceptions: false, - } + }, } as NativeScriptConfig; diff --git a/apps/toolbox/webpack.custom.config.js b/apps/toolbox/webpack.custom.config.js new file mode 100644 index 000000000..b6ffd7b43 --- /dev/null +++ b/apps/toolbox/webpack.custom.config.js @@ -0,0 +1,18 @@ +const webpack = require('webpack'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +const webpackConfig = require('./webpack.config'); + +module.exports = (env) => { + env = env || {}; + const baseConfig = webpackConfig(env); + + baseConfig.plugins.push(new webpack.DefinePlugin({ + __CI__: !!process.env.CI, + __UI_USE_XML_PARSER__: true, + __UI_USE_EXTERNAL_RENDERER__: false, + __CSS_PARSER__: JSON.stringify('css-tree') + })) + + return baseConfig; +}; diff --git a/apps/ui/.gitignore b/apps/ui/.gitignore new file mode 100644 index 000000000..9eccb5027 --- /dev/null +++ b/apps/ui/.gitignore @@ -0,0 +1 @@ +!webpack.custom.config.js \ No newline at end of file diff --git a/apps/ui/nativescript.config.ts b/apps/ui/nativescript.config.ts index 134fd50a6..0ffc08f2f 100644 --- a/apps/ui/nativescript.config.ts +++ b/apps/ui/nativescript.config.ts @@ -1,10 +1,11 @@ import { NativeScriptConfig } from '@nativescript/core'; export default { - id: 'org.nativescript.uitestsapp', + id: 'org.nativescript.uitestsapp', appResourcesPath: '../../tools/assets/App_Resources', + webpackConfigPath: 'webpack.custom.config.js', android: { v8Flags: '--expose_gc', - markingMode: 'none' + markingMode: 'none', }, } as NativeScriptConfig; diff --git a/apps/ui/webpack.custom.config.js b/apps/ui/webpack.custom.config.js new file mode 100644 index 000000000..b6ffd7b43 --- /dev/null +++ b/apps/ui/webpack.custom.config.js @@ -0,0 +1,18 @@ +const webpack = require('webpack'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); + +const webpackConfig = require('./webpack.config'); + +module.exports = (env) => { + env = env || {}; + const baseConfig = webpackConfig(env); + + baseConfig.plugins.push(new webpack.DefinePlugin({ + __CI__: !!process.env.CI, + __UI_USE_XML_PARSER__: true, + __UI_USE_EXTERNAL_RENDERER__: false, + __CSS_PARSER__: JSON.stringify('css-tree') + })) + + return baseConfig; +};