Commit 9005b484 by Steven Vachon Committed by GitHub

Replace ts-loader with Babel (#21587)

* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Removed redundant import

… that is problematic with Babel's module resolver

* Updated lockfile

* Traspile debug package to es5 for PhantomJS support

* Update babel to latest version

* Remove @babel/poolyfill and url search params polyfill

* Add ts-loader to grafana-ui dependencies

* Update prod webpack build to use cor-js 3

* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Updated lockfile

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
parent a0ad8118
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
"url": "http://github.com/grafana/grafana.git" "url": "http://github.com/grafana/grafana.git"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.6.4", "@babel/core": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
"@babel/preset-env": "7.6.3", "@babel/plugin-proposal-optional-chaining": "7.8.3",
"@babel/preset-react": "7.6.3", "@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/preset-typescript": "7.6.0", "@babel/preset-env": "7.8.3",
"@babel/preset-react": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@emotion/core": "10.0.10", "@emotion/core": "10.0.10",
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1", "@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
"@testing-library/react-hooks": "^3.2.1", "@testing-library/react-hooks": "^3.2.1",
...@@ -105,8 +107,6 @@ ...@@ -105,8 +107,6 @@
"mocha": "4.1.0", "mocha": "4.1.0",
"module-alias": "2.2.0", "module-alias": "2.2.0",
"monaco-editor": "0.15.6", "monaco-editor": "0.15.6",
"ng-annotate-loader": "0.6.1",
"ng-annotate-webpack-plugin": "0.3.0",
"ngtemplate-loader": "2.0.1", "ngtemplate-loader": "2.0.1",
"node-sass": "4.12.0", "node-sass": "4.12.0",
"npm": "6.13.4", "npm": "6.13.4",
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
"style-loader": "0.23.1", "style-loader": "0.23.1",
"terser-webpack-plugin": "1.2.3", "terser-webpack-plugin": "1.2.3",
"ts-jest": "24.1.0", "ts-jest": "24.1.0",
"ts-loader": "6.2.1",
"ts-node": "8.5.0", "ts-node": "8.5.0",
"tslib": "1.10.0", "tslib": "1.10.0",
"tslint": "5.20.1", "tslint": "5.20.1",
...@@ -199,7 +198,6 @@ ...@@ -199,7 +198,6 @@
"printWidth": 120 "printWidth": 120
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "7.6.0",
"@braintree/sanitize-url": "4.0.0", "@braintree/sanitize-url": "4.0.0",
"@grafana/slate-react": "0.22.9-grafana", "@grafana/slate-react": "0.22.9-grafana",
"@reduxjs/toolkit": "1.2.1", "@reduxjs/toolkit": "1.2.1",
...@@ -218,7 +216,7 @@ ...@@ -218,7 +216,7 @@
"calculate-size": "1.1.1", "calculate-size": "1.1.1",
"classnames": "2.2.6", "classnames": "2.2.6",
"clipboard": "2.0.4", "clipboard": "2.0.4",
"core-js": "2.6.9", "core-js": "3.6.4",
"d3": "5.15.0", "d3": "5.15.0",
"d3-scale-chromatic": "1.5.0", "d3-scale-chromatic": "1.5.0",
"emotion": "10.0.27", "emotion": "10.0.27",
...@@ -257,6 +255,7 @@ ...@@ -257,6 +255,7 @@
"redux": "4.0.4", "redux": "4.0.4",
"redux-logger": "3.0.6", "redux-logger": "3.0.6",
"redux-thunk": "2.3.0", "redux-thunk": "2.3.0",
"regenerator-runtime": "0.13.3",
"reselect": "4.0.0", "reselect": "4.0.0",
"rst2html": "github:thoward/rst2html#990cb89", "rst2html": "github:thoward/rst2html#990cb89",
"rxjs": "6.5.4", "rxjs": "6.5.4",
...@@ -267,7 +266,6 @@ ...@@ -267,7 +266,6 @@
"tether-drop": "https://github.com/torkelo/drop/tarball/master", "tether-drop": "https://github.com/torkelo/drop/tarball/master",
"tinycolor2": "1.4.1", "tinycolor2": "1.4.1",
"tti-polyfill": "0.2.2", "tti-polyfill": "0.2.2",
"url-search-params-polyfill": "7.0.1",
"whatwg-fetch": "3.0.0", "whatwg-fetch": "3.0.0",
"xss": "1.0.3" "xss": "1.0.3"
}, },
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
}, },
"main": "src/index.ts", "main": "src/index.ts",
"dependencies": { "dependencies": {
"@babel/core": "7.6.4", "@babel/core": "7.8.3",
"@babel/preset-env": "7.6.3", "@babel/preset-env": "7.8.3",
"@grafana/data": "6.7.0-pre", "@grafana/data": "6.7.0-pre",
"@grafana/ui": "6.7.0-pre", "@grafana/ui": "6.7.0-pre",
"@types/command-exists": "^1.2.0", "@types/command-exists": "^1.2.0",
......
...@@ -91,6 +91,7 @@ ...@@ -91,6 +91,7 @@
"rollup-plugin-terser": "4.0.4", "rollup-plugin-terser": "4.0.4",
"rollup-plugin-typescript2": "0.19.3", "rollup-plugin-typescript2": "0.19.3",
"rollup-plugin-visualizer": "0.9.2", "rollup-plugin-visualizer": "0.9.2",
"ts-loader": "6.2.1",
"typescript": "3.7.2" "typescript": "3.7.2"
}, },
"types": "src/index.ts" "types": "src/index.ts"
......
import '@babel/polyfill'; import 'core-js/stable';
import 'regenerator-runtime/runtime';
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; // fetch polyfill needed for PhantomJs rendering import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; // fetch polyfill needed for PhantomJs rendering
import 'url-search-params-polyfill'; // fetch polyfill needed for PhantomJs rendering // @ts-ignore
import ttiPolyfill from 'tti-polyfill';
import 'file-saver'; import 'file-saver';
import 'lodash'; import 'lodash';
import 'jquery'; import 'jquery';
...@@ -19,8 +23,6 @@ import 'vendor/angular-other/angular-strap'; ...@@ -19,8 +23,6 @@ import 'vendor/angular-other/angular-strap';
import $ from 'jquery'; import $ from 'jquery';
import angular from 'angular'; import angular from 'angular';
import config from 'app/core/config'; import config from 'app/core/config';
// @ts-ignore
import ttiPolyfill from 'tti-polyfill';
// @ts-ignore ignoring this for now, otherwise we would have to extend _ interface with move // @ts-ignore ignoring this for now, otherwise we would have to extend _ interface with move
import _ from 'lodash'; import _ from 'lodash';
import { AppEvents, setLocale, setMarkdownOptions } from '@grafana/data'; import { AppEvents, setLocale, setMarkdownOptions } from '@grafana/data';
......
// const context = require.context('./', true, /_specs\.ts/);
// context.keys().forEach(context);
// module.exports = context;
import '@babel/polyfill';
import 'jquery'; import 'jquery';
import angular from 'angular'; import angular from 'angular';
import 'angular-mocks'; import 'angular-mocks';
......
// https://github.com/TypeStrong/ts-loader/issues/653#issuecomment-390889335
const ModuleDependencyWarning = require("webpack/lib/ModuleDependencyWarning")
module.exports = class IgnoreNotFoundExportPlugin {
apply(compiler) {
const messageRegExp = /export '.*'( \(reexported as '.*'\))? was not found in/
function doneHook(stats) {
stats.compilation.warnings = stats.compilation.warnings.filter(function(warn) {
if (warn instanceof ModuleDependencyWarning && messageRegExp.test(warn.message)) {
return false
}
return true;
})
}
if (compiler.hooks) {
compiler.hooks.done.tap("IgnoreNotFoundExportPlugin", doneHook)
} else {
compiler.plugin("done", doneHook)
}
}
}
...@@ -2,7 +2,7 @@ const path = require('path'); ...@@ -2,7 +2,7 @@ const path = require('path');
// https://github.com/visionmedia/debug/issues/701#issuecomment-505487361 // https://github.com/visionmedia/debug/issues/701#issuecomment-505487361
function shouldExclude(filename) { function shouldExclude(filename) {
const packagesToProcessbyBabel = ['debug', 'lru-cache', 'yallist', 'apache-arrow', 'react-hook-form']; const packagesToProcessbyBabel = ['debug', 'lru-cache', 'yallist', 'apache-arrow', 'react-hook-form', 'rc-trigger'];
for (const package of packagesToProcessbyBabel) { for (const package of packagesToProcessbyBabel) {
if (filename.indexOf(`node_modules/${package}`) > 0) { if (filename.indexOf(`node_modules/${package}`) > 0) {
return false; return false;
...@@ -11,6 +11,7 @@ function shouldExclude(filename) { ...@@ -11,6 +11,7 @@ function shouldExclude(filename) {
return true; return true;
} }
console.log(path.resolve());
module.exports = { module.exports = {
target: 'web', target: 'web',
entry: { entry: {
...@@ -24,7 +25,11 @@ module.exports = { ...@@ -24,7 +25,11 @@ module.exports = {
}, },
resolve: { resolve: {
extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'], extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'],
alias: {}, alias: {
// rc-trigger uses babel-runtime which has internal dependency to core-js@2
// this alias maps that dependency to core-js@t3
'core-js/library/fn': 'core-js/stable',
},
modules: [path.resolve('public'), path.resolve('node_modules')], modules: [path.resolve('public'), path.resolve('node_modules')],
}, },
stats: { stats: {
......
...@@ -27,73 +27,100 @@ module.exports = (env = {}) => ...@@ -27,73 +27,100 @@ module.exports = (env = {}) =>
}, },
module: { module: {
rules: [{ // Note: order is bottom-to-top and/or right-to-left
test: /\.tsx?$/, rules: [
enforce: 'pre',
exclude: /node_modules/,
use: {
loader: 'tslint-loader',
options: {
emitErrors: true,
typeCheck: false,
}
}
},
{ {
test: /\.tsx?$/, test: /\.tsx?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: [
loader: 'ts-loader', {
options: { loader: 'babel-loader',
transpileOnly: true options: {
cacheDirectory: true,
babelrc: false,
// Note: order is top-to-bottom and/or left-to-right
plugins: [
[
require('@rtsao/plugin-proposal-class-properties'),
{
loose: true,
},
],
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'angularjs-annotate',
],
// Note: order is bottom-to-top and/or right-to-left
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: 'last 3 versions',
},
useBuiltIns: 'entry',
corejs: 3,
modules: false,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
},
}, },
}, {
loader: 'tslint-loader',
options: {
emitErrors: true,
typeCheck: false,
},
},
],
}, },
require('./sass.rule.js')({ require('./sass.rule.js')({
sourceMap: false, sourceMap: false,
preserveUrl: false preserveUrl: false,
}), }),
{ {
test: /\.(png|jpg|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/, test: /\.(png|jpg|gif|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader: 'file-loader' loader: 'file-loader',
}, },
] ],
}, },
plugins: [ plugins: [
new CleanWebpackPlugin(), new CleanWebpackPlugin(),
env.noTsCheck ? env.noTsCheck
new webpack.DefinePlugin({}) // bogus plugin to satisfy webpack API ? new webpack.DefinePlugin({}) // bogus plugin to satisfy webpack API
: : new ForkTsCheckerWebpackPlugin({
new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true,
checkSyntacticErrors: true, }),
}),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: 'grafana.[name].[hash].css' filename: 'grafana.[name].[hash].css',
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: path.resolve(__dirname, '../../public/views/error.html'), filename: path.resolve(__dirname, '../../public/views/error.html'),
template: path.resolve(__dirname, '../../public/views/error-template.html'), template: path.resolve(__dirname, '../../public/views/error-template.html'),
inject: false, inject: false,
chunksSortMode: 'none', chunksSortMode: 'none',
excludeChunks: ['dark', 'light'] excludeChunks: ['dark', 'light'],
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: path.resolve(__dirname, '../../public/views/index.html'), filename: path.resolve(__dirname, '../../public/views/index.html'),
template: path.resolve(__dirname, '../../public/views/index-template.html'), template: path.resolve(__dirname, '../../public/views/index-template.html'),
inject: false, inject: false,
chunksSortMode: 'none', chunksSortMode: 'none',
excludeChunks: ['dark', 'light'] excludeChunks: ['dark', 'light'],
}), }),
new webpack.NamedModulesPlugin(), new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { 'process.env': {
NODE_ENV: JSON.stringify('development') NODE_ENV: JSON.stringify('development'),
} },
}), }),
// new BundleAnalyzerPlugin({ // new BundleAnalyzerPlugin({
// analyzerPort: 8889 // analyzerPort: 8889
// }) // })
] ],
}); });
...@@ -7,7 +7,6 @@ const webpack = require('webpack'); ...@@ -7,7 +7,6 @@ const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin'); const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin');
const IgnoreNotFoundExportPlugin = require("./IgnoreNotFoundExportPlugin.js");
module.exports = merge(common, { module.exports = merge(common, {
mode: 'development', mode: 'development',
...@@ -36,50 +35,61 @@ module.exports = merge(common, { ...@@ -36,50 +35,61 @@ module.exports = merge(common, {
'!/public/build': 'http://localhost:3000', '!/public/build': 'http://localhost:3000',
}, },
watchOptions: { watchOptions: {
ignored: /node_modules/ ignored: /node_modules/,
} },
}, },
optimization: { optimization: {
removeAvailableModules: false, removeAvailableModules: false,
runtimeChunk: false, runtimeChunk: false,
removeEmptyChunks: false, removeEmptyChunks: false,
splitChunks: false splitChunks: false,
}, },
module: { module: {
rules: [{ // Note: order is bottom-to-top and/or right-to-left
rules: [
{
test: /\.tsx?$/, test: /\.tsx?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: [{ use: [
loader: 'babel-loader', {
options: { loader: 'babel-loader',
cacheDirectory: true, options: {
babelrc: false, cacheDirectory: true,
plugins: [ babelrc: false,
[require('@rtsao/plugin-proposal-class-properties'), { // Note: order is top-to-bottom and/or left-to-right
loose: true plugins: [
}], [
'angularjs-annotate', require('@rtsao/plugin-proposal-class-properties'),
'@babel/plugin-syntax-dynamic-import', // needed for `() => import()` in routes.ts {
'react-hot-loader/babel', loose: true,
],
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: 'last 3 versions'
}, },
useBuiltIns: 'entry', ],
modules: false '@babel/plugin-proposal-nullish-coalescing-operator',
}, '@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import', // needed for `() => import()` in routes.ts
'angularjs-annotate',
'react-hot-loader/babel',
], ],
'@babel/preset-typescript', // Note: order is bottom-to-top and/or right-to-left
'@babel/preset-react', presets: [
], [
'@babel/preset-env',
{
targets: {
browsers: 'last 3 versions',
},
useBuiltIns: 'entry',
modules: false,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
},
}, },
}, ], ],
}, },
{ {
test: /\.scss$/, test: /\.scss$/,
...@@ -90,13 +100,13 @@ module.exports = merge(common, { ...@@ -90,13 +100,13 @@ module.exports = merge(common, {
loader: 'postcss-loader', loader: 'postcss-loader',
options: { options: {
config: { config: {
path: __dirname + '/postcss.config.js' path: __dirname + '/postcss.config.js',
}, },
}, },
}, },
{ {
loader: 'sass-loader' loader: 'sass-loader',
} },
], ],
}, },
{ {
...@@ -113,7 +123,7 @@ module.exports = merge(common, { ...@@ -113,7 +123,7 @@ module.exports = merge(common, {
template: path.resolve(__dirname, '../../public/views/index-template.html'), template: path.resolve(__dirname, '../../public/views/index-template.html'),
inject: 'body', inject: 'body',
alwaysWriteToDisk: true, alwaysWriteToDisk: true,
chunksSortMode: 'none' chunksSortMode: 'none',
}), }),
new HtmlWebpackHarddiskPlugin(), new HtmlWebpackHarddiskPlugin(),
new webpack.NamedModulesPlugin(), new webpack.NamedModulesPlugin(),
...@@ -124,6 +134,5 @@ module.exports = merge(common, { ...@@ -124,6 +134,5 @@ module.exports = merge(common, {
NODE_ENV: JSON.stringify('development'), NODE_ENV: JSON.stringify('development'),
}, },
}), }),
new IgnoreNotFoundExportPlugin(),
], ],
}); });
...@@ -4,15 +4,14 @@ const merge = require('webpack-merge'); ...@@ -4,15 +4,14 @@ const merge = require('webpack-merge');
const TerserPlugin = require('terser-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const path = require('path'); const path = require('path');
const ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
module.exports = merge(common, { module.exports = merge(common, {
mode: 'production', mode: 'production',
devtool: "source-map", devtool: 'source-map',
entry: { entry: {
dark: './public/sass/grafana.dark.scss', dark: './public/sass/grafana.dark.scss',
...@@ -20,33 +19,62 @@ module.exports = merge(common, { ...@@ -20,33 +19,62 @@ module.exports = merge(common, {
}, },
module: { module: {
rules: [{ // Note: order is bottom-to-top and/or right-to-left
test: /\.tsx?$/, rules: [
enforce: 'pre',
exclude: /node_modules/,
use: {
loader: 'tslint-loader',
options: {
emitErrors: true,
typeCheck: false,
}
}
},
{ {
test: /\.tsx?$/, test: /\.tsx?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: [
loader: 'ts-loader', {
options: { loader: 'babel-loader',
transpileOnly: true options: {
cacheDirectory: true,
babelrc: false,
// Note: order is top-to-bottom and/or left-to-right
plugins: [
[
require('@rtsao/plugin-proposal-class-properties'),
{
loose: true,
},
],
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-syntax-dynamic-import', // needed for `() => import()` in routes.ts
'angularjs-annotate',
],
// Note: order is bottom-to-top and/or right-to-left
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: 'last 3 versions',
},
useBuiltIns: 'entry',
corejs: 3,
modules: false,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
},
},
{
loader: 'tslint-loader',
options: {
emitErrors: true,
typeCheck: false,
},
}, },
}, ],
}, },
require('./sass.rule.js')({ require('./sass.rule.js')({
sourceMap: false, sourceMap: false,
preserveUrl: false preserveUrl: false,
}) }),
] ],
}, },
optimization: { optimization: {
nodeEnv: 'production', nodeEnv: 'production',
...@@ -54,40 +82,39 @@ module.exports = merge(common, { ...@@ -54,40 +82,39 @@ module.exports = merge(common, {
new TerserPlugin({ new TerserPlugin({
cache: false, cache: false,
parallel: true, parallel: true,
sourceMap: true sourceMap: true,
}), }),
new OptimizeCSSAssetsPlugin({}) new OptimizeCSSAssetsPlugin({}),
] ],
}, },
plugins: [ plugins: [
new ForkTsCheckerWebpackPlugin({ new ForkTsCheckerWebpackPlugin({
checkSyntacticErrors: true, checkSyntacticErrors: true,
}), }),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: "grafana.[name].[hash].css" filename: 'grafana.[name].[hash].css',
}), }),
new ngAnnotatePlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: path.resolve(__dirname, '../../public/views/error.html'), filename: path.resolve(__dirname, '../../public/views/error.html'),
template: path.resolve(__dirname, '../../public/views/error-template.html'), template: path.resolve(__dirname, '../../public/views/error-template.html'),
inject: false, inject: false,
excludeChunks: ['dark', 'light'], excludeChunks: ['dark', 'light'],
chunksSortMode: 'none' chunksSortMode: 'none',
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
filename: path.resolve(__dirname, '../../public/views/index.html'), filename: path.resolve(__dirname, '../../public/views/index.html'),
template: path.resolve(__dirname, '../../public/views/index-template.html'), template: path.resolve(__dirname, '../../public/views/index-template.html'),
inject: false, inject: false,
excludeChunks: ['manifest', 'dark', 'light'], excludeChunks: ['manifest', 'dark', 'light'],
chunksSortMode: 'none' chunksSortMode: 'none',
}), }),
function () { function() {
this.hooks.done.tap('Done', function (stats) { this.hooks.done.tap('Done', function(stats) {
if (stats.compilation.errors && stats.compilation.errors.length) { if (stats.compilation.errors && stats.compilation.errors.length) {
console.log(stats.compilation.errors); console.log(stats.compilation.errors);
process.exit(1); process.exit(1);
} }
}); });
} },
] ],
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment