chore: apps webpack config

This commit is contained in:
Nathan Walker
2021-08-10 14:12:06 -07:00
parent fcc92f96ae
commit 4d91db193d
6 changed files with 44 additions and 4 deletions

View File

@ -40,3 +40,4 @@ app/app.scss
package-lock.json
!tools/**
!webpack.custom.config.js

View File

@ -3,9 +3,10 @@ import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'org.nativescript.ToolBox',
appResourcesPath: '../../tools/assets/App_Resources',
webpackConfigPath: 'webpack.custom.config.js',
android: {
v8Flags: '--expose_gc',
markingMode: 'none',
suppressCallJSMethodExceptions: false,
}
},
} as NativeScriptConfig;

View File

@ -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;
};

1
apps/ui/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
!webpack.custom.config.js

View File

@ -3,8 +3,9 @@ import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'org.nativescript.uitestsapp',
appResourcesPath: '../../tools/assets/App_Resources',
webpackConfigPath: 'webpack.custom.config.js',
android: {
v8Flags: '--expose_gc',
markingMode: 'none'
markingMode: 'none',
},
} as NativeScriptConfig;

View File

@ -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;
};