mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
fix(webpack): use async type-checking in watch mode
This commit is contained in:
@ -123,7 +123,12 @@ exports[`angular configuration for android 1`] = `
|
|||||||
},
|
},
|
||||||
/* config.module.rule('css') */
|
/* config.module.rule('css') */
|
||||||
{
|
{
|
||||||
test: /app(\\\\.\\\\w+)?\\\\.css$/,
|
test: /\\\\.css$/,
|
||||||
|
include: [
|
||||||
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.android.css',
|
||||||
|
/node_modules/
|
||||||
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('css').use('apply-css-loader') */
|
/* config.module.rule('css').use('apply-css-loader') */
|
||||||
{
|
{
|
||||||
@ -148,7 +153,12 @@ exports[`angular configuration for android 1`] = `
|
|||||||
},
|
},
|
||||||
/* config.module.rule('scss') */
|
/* config.module.rule('scss') */
|
||||||
{
|
{
|
||||||
test: /app(\\\\.\\\\w+)?\\\\.scss$/,
|
test: /\\\\.scss$/,
|
||||||
|
include: [
|
||||||
|
'__jest__/src/app.scss',
|
||||||
|
'__jest__/src/app.android.scss',
|
||||||
|
/node_modules/
|
||||||
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('scss').use('apply-css-loader') */
|
/* config.module.rule('scss').use('apply-css-loader') */
|
||||||
{
|
{
|
||||||
@ -206,7 +216,9 @@ exports[`angular configuration for android 1`] = `
|
|||||||
{
|
{
|
||||||
test: /\\\\.css$/,
|
test: /\\\\.css$/,
|
||||||
exclude: [
|
exclude: [
|
||||||
/app(\\\\.\\\\w+)?\\\\.css$/
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.android.css',
|
||||||
|
/node_modules/
|
||||||
],
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('css|component').use('raw-loader') */
|
/* config.module.rule('css|component').use('raw-loader') */
|
||||||
@ -219,7 +231,9 @@ exports[`angular configuration for android 1`] = `
|
|||||||
{
|
{
|
||||||
test: /\\\\.scss$/,
|
test: /\\\\.scss$/,
|
||||||
exclude: [
|
exclude: [
|
||||||
/app(\\\\.\\\\w+)?\\\\.scss$/
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.android.css',
|
||||||
|
/node_modules/
|
||||||
],
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('scss|component').use('raw-loader') */
|
/* config.module.rule('scss|component').use('raw-loader') */
|
||||||
@ -494,7 +508,12 @@ exports[`angular configuration for ios 1`] = `
|
|||||||
},
|
},
|
||||||
/* config.module.rule('css') */
|
/* config.module.rule('css') */
|
||||||
{
|
{
|
||||||
test: /app(\\\\.\\\\w+)?\\\\.css$/,
|
test: /\\\\.css$/,
|
||||||
|
include: [
|
||||||
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.ios.css',
|
||||||
|
/node_modules/
|
||||||
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('css').use('apply-css-loader') */
|
/* config.module.rule('css').use('apply-css-loader') */
|
||||||
{
|
{
|
||||||
@ -519,7 +538,12 @@ exports[`angular configuration for ios 1`] = `
|
|||||||
},
|
},
|
||||||
/* config.module.rule('scss') */
|
/* config.module.rule('scss') */
|
||||||
{
|
{
|
||||||
test: /app(\\\\.\\\\w+)?\\\\.scss$/,
|
test: /\\\\.scss$/,
|
||||||
|
include: [
|
||||||
|
'__jest__/src/app.scss',
|
||||||
|
'__jest__/src/app.ios.scss',
|
||||||
|
/node_modules/
|
||||||
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('scss').use('apply-css-loader') */
|
/* config.module.rule('scss').use('apply-css-loader') */
|
||||||
{
|
{
|
||||||
@ -577,7 +601,9 @@ exports[`angular configuration for ios 1`] = `
|
|||||||
{
|
{
|
||||||
test: /\\\\.css$/,
|
test: /\\\\.css$/,
|
||||||
exclude: [
|
exclude: [
|
||||||
/app(\\\\.\\\\w+)?\\\\.css$/
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.ios.css',
|
||||||
|
/node_modules/
|
||||||
],
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('css|component').use('raw-loader') */
|
/* config.module.rule('css|component').use('raw-loader') */
|
||||||
@ -590,7 +616,9 @@ exports[`angular configuration for ios 1`] = `
|
|||||||
{
|
{
|
||||||
test: /\\\\.scss$/,
|
test: /\\\\.scss$/,
|
||||||
exclude: [
|
exclude: [
|
||||||
/app(\\\\.\\\\w+)?\\\\.scss$/
|
'__jest__/src/app.css',
|
||||||
|
'__jest__/src/app.ios.css',
|
||||||
|
/node_modules/
|
||||||
],
|
],
|
||||||
use: [
|
use: [
|
||||||
/* config.module.rule('scss|component').use('raw-loader') */
|
/* config.module.rule('scss|component').use('raw-loader') */
|
||||||
|
@ -223,6 +223,7 @@ exports[`base configuration for android 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -530,6 +531,7 @@ exports[`base configuration for ios 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,7 @@ exports[`javascript configuration for android 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -320,10 +321,10 @@ exports[`javascript configuration for android 1`] = `
|
|||||||
entry: {
|
entry: {
|
||||||
bundle: [
|
bundle: [
|
||||||
'@nativescript/core/globals/index.js',
|
'@nativescript/core/globals/index.js',
|
||||||
|
'__jest__/src/__@nativescript_webpack_virtual_entry_javascript__',
|
||||||
'__jest__/src/app.js',
|
'__jest__/src/app.js',
|
||||||
'@nativescript/core/ui/frame',
|
'@nativescript/core/ui/frame',
|
||||||
'@nativescript/core/ui/frame/activity',
|
'@nativescript/core/ui/frame/activity'
|
||||||
'__jest__/src/__@nativescript_webpack_virtual_entry_javascript__'
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
@ -569,6 +570,7 @@ exports[`javascript configuration for ios 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -649,8 +651,8 @@ exports[`javascript configuration for ios 1`] = `
|
|||||||
entry: {
|
entry: {
|
||||||
bundle: [
|
bundle: [
|
||||||
'@nativescript/core/globals/index.js',
|
'@nativescript/core/globals/index.js',
|
||||||
'__jest__/src/app.js',
|
'__jest__/src/__@nativescript_webpack_virtual_entry_javascript__',
|
||||||
'__jest__/src/__@nativescript_webpack_virtual_entry_javascript__'
|
'__jest__/src/app.js'
|
||||||
],
|
],
|
||||||
'tns_modules/inspector_modules': [
|
'tns_modules/inspector_modules': [
|
||||||
'@nativescript/core/inspector_modules'
|
'@nativescript/core/inspector_modules'
|
||||||
|
@ -238,6 +238,7 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -556,6 +557,7 @@ exports[`react configuration > android > base config 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -874,6 +876,7 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -1193,6 +1196,7 @@ exports[`react configuration > ios > base config 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
|
@ -248,6 +248,7 @@ exports[`svelte configuration for android 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -574,6 +575,7 @@ exports[`svelte configuration for ios 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
|
@ -240,6 +240,7 @@ exports[`typescript configuration for android 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -320,10 +321,10 @@ exports[`typescript configuration for android 1`] = `
|
|||||||
entry: {
|
entry: {
|
||||||
bundle: [
|
bundle: [
|
||||||
'@nativescript/core/globals/index.js',
|
'@nativescript/core/globals/index.js',
|
||||||
|
'__jest__/src/__@nativescript_webpack_virtual_entry_typescript__',
|
||||||
'__jest__/src/app.js',
|
'__jest__/src/app.js',
|
||||||
'@nativescript/core/ui/frame',
|
'@nativescript/core/ui/frame',
|
||||||
'@nativescript/core/ui/frame/activity',
|
'@nativescript/core/ui/frame/activity'
|
||||||
'__jest__/src/__@nativescript_webpack_virtual_entry_typescript__'
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
@ -569,6 +570,7 @@ exports[`typescript configuration for ios 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096
|
memoryLimit: 4096
|
||||||
}
|
}
|
||||||
@ -649,8 +651,8 @@ exports[`typescript configuration for ios 1`] = `
|
|||||||
entry: {
|
entry: {
|
||||||
bundle: [
|
bundle: [
|
||||||
'@nativescript/core/globals/index.js',
|
'@nativescript/core/globals/index.js',
|
||||||
'__jest__/src/app.js',
|
'__jest__/src/__@nativescript_webpack_virtual_entry_typescript__',
|
||||||
'__jest__/src/__@nativescript_webpack_virtual_entry_typescript__'
|
'__jest__/src/app.js'
|
||||||
],
|
],
|
||||||
'tns_modules/inspector_modules': [
|
'tns_modules/inspector_modules': [
|
||||||
'@nativescript/core/inspector_modules'
|
'@nativescript/core/inspector_modules'
|
||||||
|
@ -257,6 +257,7 @@ exports[`vue configuration for android 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096,
|
memoryLimit: 4096,
|
||||||
extensions: {
|
extensions: {
|
||||||
@ -598,6 +599,7 @@ exports[`vue configuration for ios 1`] = `
|
|||||||
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
/* config.plugin('ForkTsCheckerWebpackPlugin') */
|
||||||
new ForkTsCheckerWebpackPlugin(
|
new ForkTsCheckerWebpackPlugin(
|
||||||
{
|
{
|
||||||
|
async: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096,
|
memoryLimit: 4096,
|
||||||
extensions: {
|
extensions: {
|
||||||
|
@ -56,6 +56,8 @@ program
|
|||||||
env['env'] = options.env;
|
env['env'] = options.env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env['watch'] = options.watch;
|
||||||
|
|
||||||
const configPath = (() => {
|
const configPath = (() => {
|
||||||
if (options.config) {
|
if (options.config) {
|
||||||
return path.resolve(options.config);
|
return path.resolve(options.config);
|
||||||
|
@ -186,7 +186,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
|||||||
paths.indexOf('@nativescript/core/globals/index.js')
|
paths.indexOf('@nativescript/core/globals/index.js')
|
||||||
] = polyfillsPath;
|
] = polyfillsPath;
|
||||||
|
|
||||||
// replace paths with the update paths
|
// replace paths with the updated paths
|
||||||
config.entry('bundle').clear().merge(paths);
|
config.entry('bundle').clear().merge(paths);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,11 +233,7 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
|
|||||||
.plugin('ForkTsCheckerWebpackPlugin')
|
.plugin('ForkTsCheckerWebpackPlugin')
|
||||||
.use(ForkTsCheckerWebpackPlugin, [
|
.use(ForkTsCheckerWebpackPlugin, [
|
||||||
{
|
{
|
||||||
// If we use "async" errors compiling typescript will be ignored by
|
async: !!env.watch,
|
||||||
// WebPack (we will send the "compilation" message back to the CLI,
|
|
||||||
// and the process exit code will be zero), therefore we will end
|
|
||||||
// up with a broken build
|
|
||||||
async: false,
|
|
||||||
typescript: {
|
typescript: {
|
||||||
memoryLimit: 4096,
|
memoryLimit: 4096,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user