Browse Source

Attempts to speed up builds

main
Eric Amodio 5 years ago
parent
commit
2cedc7146a
1 changed files with 24 additions and 6 deletions
  1. +24
    -6
      webpack.config.js

+ 24
- 6
webpack.config.js View File

@ -7,6 +7,7 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPl
const { CleanWebpackPlugin: CleanPlugin } = require('clean-webpack-plugin'); const { CleanWebpackPlugin: CleanPlugin } = require('clean-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin'); const CircularDependencyPlugin = require('circular-dependency-plugin');
const CspHtmlPlugin = require('csp-html-webpack-plugin'); const CspHtmlPlugin = require('csp-html-webpack-plugin');
// const ESLintPlugin = require('eslint-webpack-plugin');
const ForkTsCheckerPlugin = require('fork-ts-checker-webpack-plugin'); const ForkTsCheckerPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlExcludeAssetsPlugin = require('html-webpack-exclude-assets-plugin'); const HtmlExcludeAssetsPlugin = require('html-webpack-exclude-assets-plugin');
const HtmlInlineSourcePlugin = require('html-webpack-inline-source-plugin'); const HtmlInlineSourcePlugin = require('html-webpack-inline-source-plugin');
@ -35,9 +36,15 @@ function getExtensionConfig(env) {
*/ */
const plugins = [ const plugins = [
new CleanPlugin({ cleanOnceBeforeBuildPatterns: ['**/*', '!**/webviews/**'] }), new CleanPlugin({ cleanOnceBeforeBuildPatterns: ['**/*', '!**/webviews/**'] }),
// new ESLintPlugin({
// context: path.resolve(__dirname, 'src'),
// files: '**/*.ts',
// lintDirtyModulesOnly: true
// })
new ForkTsCheckerPlugin({ new ForkTsCheckerPlugin({
async: false, async: false,
eslint: true
eslint: true,
useTypescriptIncrementalApi: true
}) })
]; ];
@ -95,7 +102,8 @@ function getExtensionConfig(env) {
module: { module: {
rules: [ rules: [
{ {
exclude: /node_modules|\.d\.ts$/,
exclude: /\.d\.ts$/,
include: path.resolve(__dirname, 'src'),
test: /\.tsx?$/, test: /\.tsx?$/,
use: { use: {
loader: 'ts-loader', loader: 'ts-loader',
@ -108,7 +116,8 @@ function getExtensionConfig(env) {
] ]
}, },
resolve: { resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json']
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
symlinks: false
}, },
plugins: plugins, plugins: plugins,
stats: { stats: {
@ -146,10 +155,16 @@ function getWebviewsConfig(env) {
*/ */
const plugins = [ const plugins = [
new CleanPlugin({ cleanOnceBeforeBuildPatterns: clean }), new CleanPlugin({ cleanOnceBeforeBuildPatterns: clean }),
// new ESLintPlugin({
// context: path.resolve(__dirname, 'src/webviews/apps'),
// files: '**/*.ts',
// lintDirtyModulesOnly: true
// }),
new ForkTsCheckerPlugin({ new ForkTsCheckerPlugin({
tsconfig: path.resolve(__dirname, 'tsconfig.webviews.json'), tsconfig: path.resolve(__dirname, 'tsconfig.webviews.json'),
async: false, async: false,
eslint: true
eslint: true,
useTypescriptIncrementalApi: true
}), }),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: '[name].css' filename: '[name].css'
@ -250,12 +265,14 @@ function getWebviewsConfig(env) {
module: { module: {
rules: [ rules: [
{ {
exclude: /node_modules|\.d\.ts$/,
exclude: /\.d\.ts$/,
include: path.resolve(__dirname, 'src'),
test: /\.tsx?$/, test: /\.tsx?$/,
use: { use: {
loader: 'ts-loader', loader: 'ts-loader',
options: { options: {
configFile: 'tsconfig.webviews.json', configFile: 'tsconfig.webviews.json',
experimentalWatchApi: true,
transpileOnly: true transpileOnly: true
} }
} }
@ -286,7 +303,8 @@ function getWebviewsConfig(env) {
}, },
resolve: { resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
modules: [path.resolve(__dirname, 'src/webviews/apps'), 'node_modules']
modules: [path.resolve(__dirname, 'src/webviews/apps'), 'node_modules'],
symlinks: false
}, },
plugins: plugins, plugins: plugins,
stats: { stats: {

Loading…
Cancel
Save