From fad4eb348813f400462573e1c11c24c2b46b1ce8 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 2 Jan 2020 13:42:45 -0800 Subject: [PATCH 1/3] Move webpack scripts into one place --- .../webpack/webpack.config.js | 7 +- .../webpack/webpack.datascience-ui.config.js | 787 +++++++++--------- .../webpack.extension.dependencies.config.js | 1 + gulpfile.js | 8 +- 4 files changed, 401 insertions(+), 402 deletions(-) rename webpack.config.js => build/webpack/webpack.config.js (86%) rename webpack.datascience-ui.config.js => build/webpack/webpack.datascience-ui.config.js (65%) diff --git a/webpack.config.js b/build/webpack/webpack.config.js similarity index 86% rename from webpack.config.js rename to build/webpack/webpack.config.js index 391ab76afd30..d298b1b8b9cc 100644 --- a/webpack.config.js +++ b/build/webpack/webpack.config.js @@ -5,7 +5,7 @@ const merge = require('webpack-merge'); const datascience = require('./webpack.datascience-ui.config.js'); -const extensionDependencies = require('./build/webpack/webpack.extension.dependencies.config.js').default; +const extensionDependencies = require('./webpack.extension.dependencies.config.js').default; const configurations = [ // history-react @@ -26,18 +26,17 @@ const configurations = [ }), merge(extensionDependencies, { mode: 'production', - devtool: 'source-map', + devtool: 'source-map' }) ]; // Dirty temporary hack. // If the environment variable BUNDLE_INDEX is defined, then return just one item in the array. // Refer issue for further details (https://github.com/microsoft/vscode-python/issues/9055) -if (process.env.BUNDLE_INDEX){ +if (process.env.BUNDLE_INDEX) { console.info(`Using Optimized Build, Bundle Index ${process.env.BUNDLE_INDEX}`); module.exports = [configurations[parseInt(process.env.BUNDLE_INDEX, 10)]]; } else { console.info('Not using Optimized Build'); module.exports = configurations; } - diff --git a/webpack.datascience-ui.config.js b/build/webpack/webpack.datascience-ui.config.js similarity index 65% rename from webpack.datascience-ui.config.js rename to build/webpack/webpack.datascience-ui.config.js index afa30d9f55be..5fad11a26cd0 100644 --- a/webpack.datascience-ui.config.js +++ b/build/webpack/webpack.datascience-ui.config.js @@ -1,394 +1,393 @@ - -// Note to editors, if you change this file you have to restart compile-webviews. -// It doesn't reload the config otherwise. -const webpack = require('webpack'); -const HtmlWebpackPlugin = require('html-webpack-plugin'); -const FixDefaultImportPlugin = require('webpack-fix-default-import-plugin'); -const path = require('path'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); -const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin') - -const configFileName = 'tsconfig.datascience-ui.json'; - -module.exports = [ - { - entry: ['babel-polyfill', './src/datascience-ui/history-react/index.tsx'], - output: { - path: path.join(__dirname, 'out'), - filename: 'datascience-ui/history-react/index_bundle.js', - publicPath: './' - }, - mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. - // Use 'eval' for release and `eval-source-map` for development. - // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, - // this seems to prevent chrome from downloading the source maps) - devtool: 'eval-source-map', - optimization: { - minimizer: [new TerserPlugin()] - }, - node: { - fs: 'empty' - }, - plugins: [ - new HtmlWebpackPlugin({ template: 'src/datascience-ui/history-react/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/history-react`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/history-react/index.html' }), - new FixDefaultImportPlugin(), - new CopyWebpackPlugin([ - { from: './**/*.png', to: '.' }, - { from: './**/*.svg', to: '.' }, - { from: './**/*.css', to: '.' }, - { from: './**/*theme*.json', to: '.' } - ], { context: 'src' }), - new MonacoWebpackPlugin({ - languages: [] // force to empty so onigasm will be used - }) - ], - resolve: { - // Add '.ts' and '.tsx' as resolvable extensions. - extensions: [".ts", ".tsx", ".js", ".json", ".svg"] - }, - - module: { - rules: [ - // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. - { - test: /\.tsx?$/, - use: { - loader: "awesome-typescript-loader", - options: { - configFileName, - reportFiles: [ - 'src/datascience-ui/**/*.{ts,tsx}' - ] - }, - } - }, - { - test: /\.svg$/, - use: [ - 'svg-inline-loader' - ] - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ], - }, - { - test: /\.js$/, - include: /node_modules.*remark.*default.*js/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), - options: {} - } - ] - }, - { - test: /\.json$/, - type: 'javascript/auto', - include: /node_modules.*remark.*/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/jsonloader.js'), - options: {} - } - ] - }, - { test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' }, - { - test: /\.less$/, - use: [ - 'style-loader', - 'css-loader', - 'less-loader' - ] - } - ] - } - }, - { - entry: ['babel-polyfill', './src/datascience-ui/native-editor/index.tsx'], - output: { - path: path.join(__dirname, 'out'), - filename: 'datascience-ui/native-editor/index_bundle.js', - publicPath: './' - }, - - mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. - // Use 'eval' for release and `eval-source-map` for development. - // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, - // this seems to prevent chrome from downloading the source maps) - devtool: 'eval-source-map', - optimization: { - minimizer: [new TerserPlugin()] - }, - node: { - fs: 'empty' - }, - plugins: [ - new HtmlWebpackPlugin({ template: 'src/datascience-ui/native-editor/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/native-editor`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/native-editor/index.html' }), - new FixDefaultImportPlugin(), - new CopyWebpackPlugin([ - { from: './**/*.png', to: '.' }, - { from: './**/*.svg', to: '.' }, - { from: './**/*.css', to: '.' }, - { from: './**/*theme*.json', to: '.' } - ], { context: 'src' }), - new MonacoWebpackPlugin({ - languages: [] // force to empty so onigasm will be used - }) - ], - resolve: { - // Add '.ts' and '.tsx' as resolvable extensions. - extensions: [".ts", ".tsx", ".js", ".json", ".svg"] - }, - - module: { - rules: [ - // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. - { - test: /\.tsx?$/, - use: { - loader: "awesome-typescript-loader", - options: { - configFileName, - reportFiles: [ - 'src/datascience-ui/**/*.{ts,tsx}' - ] - }, - } - }, - { - test: /\.svg$/, - use: [ - 'svg-inline-loader' - ] - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ], - }, - { - test: /\.js$/, - include: /node_modules.*remark.*default.*js/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), - options: {} - } - ] - }, - { - test: /\.json$/, - type: 'javascript/auto', - include: /node_modules.*remark.*/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/jsonloader.js'), - options: {} - } - ] - }, - { test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' }, - { - test: /\.less$/, - use: [ - 'style-loader', - 'css-loader', - 'less-loader' - ] - } - ] - } - }, - { - entry: ['babel-polyfill', './src/datascience-ui/data-explorer/index.tsx'], - output: { - path: path.join(__dirname, 'out'), - filename: 'datascience-ui/data-explorer/index_bundle.js', - publicPath: './' - }, - - mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. - // Use 'eval' for release and `eval-source-map` for development. - // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, - // this seems to prevent chrome from downloading the source maps) - devtool: 'eval-source-map', - optimization: { - minimizer: [new TerserPlugin()] - }, - node: { - fs: 'empty' - }, - plugins: [ - new HtmlWebpackPlugin({ template: 'src/datascience-ui/data-explorer/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/data-explorer`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/data-explorer/index.html' }), - new FixDefaultImportPlugin(), - new CopyWebpackPlugin([ - { from: './**/*.png', to: '.' }, - { from: './**/*.svg', to: '.' }, - { from: './**/*.css', to: '.' }, - { from: './**/*theme*.json', to: '.' } - ], { context: 'src' }), - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: JSON.stringify("production") - } - }) - ], - resolve: { - // Add '.ts' and '.tsx' as resolvable extensions. - extensions: [".ts", ".tsx", ".js", ".json", ".svg"] - }, - - module: { - rules: [ - // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. - { - test: /\.tsx?$/, - use: { - loader: "awesome-typescript-loader", - options: { - configFileName, - reportFiles: [ - 'src/datascience-ui/**/*.{ts,tsx}' - ] - }, - } - }, - { - test: /\.svg$/, - use: [ - 'svg-inline-loader' - ] - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ], - }, - { - test: /\.js$/, - include: /node_modules.*remark.*default.*js/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), - options: {} - } - ] - }, - { test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' }, - { - test: /\.json$/, - type: 'javascript/auto', - include: /node_modules.*remark.*/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/jsonloader.js'), - options: {} - } - ] - } - ] - } - }, - { - entry: ['babel-polyfill', './src/datascience-ui/plot/index.tsx'], - output: { - path: path.join(__dirname, 'out'), - filename: 'datascience-ui/plot/index_bundle.js', - publicPath: './' - }, - - mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. - // Use 'eval' for release and `eval-source-map` for development. - // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, - // this seems to prevent chrome from downloading the source maps) - devtool: 'eval-source-map', - optimization: { - minimizer: [new TerserPlugin()] - }, - node: { - fs: 'empty' - }, - plugins: [ - new HtmlWebpackPlugin({ template: 'src/datascience-ui/plot/index.html', imageBaseUrl: `${__dirname.replace(/\\/g, '/')}/out/datascience-ui/plot`, indexUrl: `${__dirname}/out/1`, filename: './datascience-ui/plot/index.html' }), - new FixDefaultImportPlugin(), - new CopyWebpackPlugin([ - { from: './**/*.png', to: '.' }, - { from: './**/*.svg', to: '.' }, - { from: './**/*.css', to: '.' }, - { from: './**/*theme*.json', to: '.' } - ], { context: 'src' }), - new webpack.DefinePlugin({ - "process.env": { - NODE_ENV: JSON.stringify("production") - } - }) - ], - resolve: { - // Add '.ts' and '.tsx' as resolvable extensions. - extensions: [".ts", ".tsx", ".js", ".json", ".svg"] - }, - - module: { - rules: [ - // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. - { - test: /\.tsx?$/, - use: { - loader: "awesome-typescript-loader", - options: { - configFileName, - reportFiles: [ - 'src/datascience-ui/**/*.{ts,tsx}' - ] - }, - } - }, - { - test: /\.svg$/, - use: [ - 'svg-inline-loader' - ] - }, - { - test: /\.css$/, - use: [ - 'style-loader', - 'css-loader' - ], - }, - { - test: /\.js$/, - include: /node_modules.*remark.*default.*js/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), - options: {} - } - ] - }, - { test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' }, - { - test: /\.json$/, - type: 'javascript/auto', - include: /node_modules.*remark.*/, - use: [ - { - loader: path.resolve('./build/webpack/loaders/jsonloader.js'), - options: {} - } - ] - } - ] - } - } -]; +// Note to editors, if you change this file you have to restart compile-webviews. +// It doesn't reload the config otherwise. +const webpack = require('webpack'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const FixDefaultImportPlugin = require('webpack-fix-default-import-plugin'); +const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); +const constants = require('../constants'); +const configFileName = 'tsconfig.datascience-ui.json'; + +module.exports = [ + { + context: constants.ExtensionRootDir, + entry: ['babel-polyfill', './src/datascience-ui/history-react/index.tsx'], + output: { + path: path.join(constants.ExtensionRootDir, 'out'), + filename: 'datascience-ui/history-react/index_bundle.js', + publicPath: './' + }, + mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. + // Use 'eval' for release and `eval-source-map` for development. + // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, + // this seems to prevent chrome from downloading the source maps) + devtool: 'eval-source-map', + optimization: { + minimizer: [new TerserPlugin()] + }, + node: { + fs: 'empty' + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/datascience-ui/history-react/index.html', + imageBaseUrl: `${constants.ExtensionRootDir.replace(/\\/g, '/')}/out/datascience-ui/history-react`, + indexUrl: `${constants.ExtensionRootDir}/out/1`, + filename: './datascience-ui/history-react/index.html' + }), + new FixDefaultImportPlugin(), + new CopyWebpackPlugin( + [ + { from: './**/*.png', to: '.' }, + { from: './**/*.svg', to: '.' }, + { from: './**/*.css', to: '.' }, + { from: './**/*theme*.json', to: '.' } + ], + { context: 'src' } + ), + new MonacoWebpackPlugin({ + languages: [] // force to empty so onigasm will be used + }) + ], + resolve: { + // Add '.ts' and '.tsx' as resolvable extensions. + extensions: ['.ts', '.tsx', '.js', '.json', '.svg'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + use: { + loader: 'awesome-typescript-loader', + options: { + configFileName, + reportFiles: ['src/datascience-ui/**/*.{ts,tsx}'] + } + } + }, + { + test: /\.svg$/, + use: ['svg-inline-loader'] + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.js$/, + include: /node_modules.*remark.*default.*js/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), + options: {} + } + ] + }, + { + test: /\.json$/, + type: 'javascript/auto', + include: /node_modules.*remark.*/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/jsonloader.js'), + options: {} + } + ] + }, + { test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' }, + { + test: /\.less$/, + use: ['style-loader', 'css-loader', 'less-loader'] + } + ] + } + }, + { + context: constants.ExtensionRootDir, + entry: ['babel-polyfill', './src/datascience-ui/native-editor/index.tsx'], + output: { + path: path.join(constants.ExtensionRootDir, 'out'), + filename: 'datascience-ui/native-editor/index_bundle.js', + publicPath: './' + }, + + mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. + // Use 'eval' for release and `eval-source-map` for development. + // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, + // this seems to prevent chrome from downloading the source maps) + devtool: 'eval-source-map', + optimization: { + minimizer: [new TerserPlugin()] + }, + node: { + fs: 'empty' + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/datascience-ui/native-editor/index.html', + imageBaseUrl: `${constants.ExtensionRootDir.replace(/\\/g, '/')}/out/datascience-ui/native-editor`, + indexUrl: `${constants.ExtensionRootDir}/out/1`, + filename: './datascience-ui/native-editor/index.html' + }), + new FixDefaultImportPlugin(), + new CopyWebpackPlugin( + [ + { from: './**/*.png', to: '.' }, + { from: './**/*.svg', to: '.' }, + { from: './**/*.css', to: '.' }, + { from: './**/*theme*.json', to: '.' } + ], + { context: 'src' } + ), + new MonacoWebpackPlugin({ + languages: [] // force to empty so onigasm will be used + }) + ], + resolve: { + // Add '.ts' and '.tsx' as resolvable extensions. + extensions: ['.ts', '.tsx', '.js', '.json', '.svg'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + use: { + loader: 'awesome-typescript-loader', + options: { + configFileName, + reportFiles: ['src/datascience-ui/**/*.{ts,tsx}'] + } + } + }, + { + test: /\.svg$/, + use: ['svg-inline-loader'] + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.js$/, + include: /node_modules.*remark.*default.*js/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), + options: {} + } + ] + }, + { + test: /\.json$/, + type: 'javascript/auto', + include: /node_modules.*remark.*/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/jsonloader.js'), + options: {} + } + ] + }, + { test: /\.(png|woff|woff2|eot|ttf)$/, loader: 'url-loader?limit=100000' }, + { + test: /\.less$/, + use: ['style-loader', 'css-loader', 'less-loader'] + } + ] + } + }, + { + context: constants.ExtensionRootDir, + entry: ['babel-polyfill', './src/datascience-ui/data-explorer/index.tsx'], + output: { + path: path.join(constants.ExtensionRootDir, 'out'), + filename: 'datascience-ui/data-explorer/index_bundle.js', + publicPath: './' + }, + + mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. + // Use 'eval' for release and `eval-source-map` for development. + // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, + // this seems to prevent chrome from downloading the source maps) + devtool: 'eval-source-map', + optimization: { + minimizer: [new TerserPlugin()] + }, + node: { + fs: 'empty' + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/datascience-ui/data-explorer/index.html', + imageBaseUrl: `${constants.ExtensionRootDir.replace(/\\/g, '/')}/out/datascience-ui/data-explorer`, + indexUrl: `${constants.ExtensionRootDir}/out/1`, + filename: './datascience-ui/data-explorer/index.html' + }), + new FixDefaultImportPlugin(), + new CopyWebpackPlugin( + [ + { from: './**/*.png', to: '.' }, + { from: './**/*.svg', to: '.' }, + { from: './**/*.css', to: '.' }, + { from: './**/*theme*.json', to: '.' } + ], + { context: 'src' } + ), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify('production') + } + }) + ], + resolve: { + // Add '.ts' and '.tsx' as resolvable extensions. + extensions: ['.ts', '.tsx', '.js', '.json', '.svg'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + use: { + loader: 'awesome-typescript-loader', + options: { + configFileName, + reportFiles: ['src/datascience-ui/**/*.{ts,tsx}'] + } + } + }, + { + test: /\.svg$/, + use: ['svg-inline-loader'] + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.js$/, + include: /node_modules.*remark.*default.*js/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), + options: {} + } + ] + }, + { test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' }, + { + test: /\.json$/, + type: 'javascript/auto', + include: /node_modules.*remark.*/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/jsonloader.js'), + options: {} + } + ] + } + ] + } + }, + { + context: constants.ExtensionRootDir, + entry: ['babel-polyfill', './src/datascience-ui/plot/index.tsx'], + output: { + path: path.join(constants.ExtensionRootDir, 'out'), + filename: 'datascience-ui/plot/index_bundle.js', + publicPath: './' + }, + + mode: 'development', // Leave as is, we'll need to see stack traces when there are errors. + // Use 'eval' for release and `eval-source-map` for development. + // We need to use one where source is embedded, due to webviews (they restrict resources to specific schemes, + // this seems to prevent chrome from downloading the source maps) + devtool: 'eval-source-map', + optimization: { + minimizer: [new TerserPlugin()] + }, + node: { + fs: 'empty' + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/datascience-ui/plot/index.html', + imageBaseUrl: `${constants.ExtensionRootDir.replace(/\\/g, '/')}/out/datascience-ui/plot`, + indexUrl: `${constants.ExtensionRootDir}/out/1`, + filename: './datascience-ui/plot/index.html' + }), + new FixDefaultImportPlugin(), + new CopyWebpackPlugin( + [ + { from: './**/*.png', to: '.' }, + { from: './**/*.svg', to: '.' }, + { from: './**/*.css', to: '.' }, + { from: './**/*theme*.json', to: '.' } + ], + { context: 'src' } + ), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify('production') + } + }) + ], + resolve: { + // Add '.ts' and '.tsx' as resolvable extensions. + extensions: ['.ts', '.tsx', '.js', '.json', '.svg'] + }, + + module: { + rules: [ + // All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. + { + test: /\.tsx?$/, + use: { + loader: 'awesome-typescript-loader', + options: { + configFileName, + reportFiles: ['src/datascience-ui/**/*.{ts,tsx}'] + } + } + }, + { + test: /\.svg$/, + use: ['svg-inline-loader'] + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.js$/, + include: /node_modules.*remark.*default.*js/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/remarkLoader.js'), + options: {} + } + ] + }, + { test: /\.(png|woff|woff2|eot|gif|ttf)$/, loader: 'url-loader?limit=100000' }, + { + test: /\.json$/, + type: 'javascript/auto', + include: /node_modules.*remark.*/, + use: [ + { + loader: path.resolve('./build/webpack/loaders/jsonloader.js'), + options: {} + } + ] + } + ] + } + } +]; diff --git a/build/webpack/webpack.extension.dependencies.config.js b/build/webpack/webpack.extension.dependencies.config.js index 6ff5b38dd7a4..309af504815a 100644 --- a/build/webpack/webpack.extension.dependencies.config.js +++ b/build/webpack/webpack.extension.dependencies.config.js @@ -14,6 +14,7 @@ common.nodeModulesToExternalize.forEach(moduleName => { const config = { mode: 'production', target: 'node', + context: constants.ExtensionRootDir, entry: entryItems, devtool: 'source-map', node: { diff --git a/gulpfile.js b/gulpfile.js index 6a665b8ae835..ae43ab07944b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -111,10 +111,10 @@ gulp.task('checkNativeDependencies', done => { gulp.task('check-datascience-dependencies', () => checkDatascienceDependencies()); gulp.task('compile-webviews', async () => { - await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', 'webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '0'}); - await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', 'webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '1'}); - await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', 'webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '2'}); - await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', 'webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '3'}); + await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', './build/webpack/webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '0'}); + await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', './build/webpack/webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '1'}); + await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', './build/webpack/webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '2'}); + await spawnAsync('npx', ['-n', '--max_old_space_size=9096', 'webpack', '--config', './build/webpack/webpack.config.js', '--mode', 'production'], {'BUNDLE_INDEX': '3'}); }); gulp.task('webpack', async () => { From aa10bfabf72baf03bb8ac4df153b493bf037a08f Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 2 Jan 2020 13:46:44 -0800 Subject: [PATCH 2/3] More fixes --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 308d6bc94f55..f948f8318342 100644 --- a/package.json +++ b/package.json @@ -2699,11 +2699,11 @@ "scripts": { "package": "gulp clean && gulp prePublishBundle && vsce package -o ms-python-insiders.vsix", "compile": "tsc -watch -p ./", - "compile-webviews-watch": "npx npx -n --max_old_space_size=9096 webpack --config webpack.datascience-ui.config.js --watch", + "compile-webviews-watch": "npx npx -n --max_old_space_size=9096 webpack --config ./build/webpack/webpack.datascience-ui.config.js --watch", "checkDependencies": "gulp checkDependencies", - "dump-datascience-webpack-stats": "npx -n --max_old_space_size=9096 webpack --config webpack.datascience-ui.config.js --profile --json > tmp/ds-stats.json", + "dump-datascience-webpack-stats": "npx -n --max_old_space_size=9096 webpack --config ./build/webpack/webpack.datascience-ui.config.js --profile --json > tmp/ds-stats.json", "compile-webviews": "gulp compile-webviews", - "compile-webviews-verbose": "npx webpack --config webpack.datascience-ui.config.js", + "compile-webviews-verbose": "npx webpack --config ./build/webpack/webpack.datascience-ui.config.js", "postinstall": "node ./build/ci/postInstall.js", "test": "node ./out/test/standardTest.js && node ./out/test/multiRootTest.js", "test:unittests": "mocha --opts ./build/.mocha.unittests.js.opts", From 1c55947d61aca3b8e38bfd86634a7ce15eca6055 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 2 Jan 2020 15:16:23 -0800 Subject: [PATCH 3/3] Fix scripts --- gulpfile.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ae43ab07944b..04d8e46891cf 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -120,11 +120,11 @@ gulp.task('compile-webviews', async () => { gulp.task('webpack', async () => { // Build node_modules and DS stuff. // Unwrap the array used to build each webpack. - await buildWebPack('production', [], {'BUNDLE_INDEX': '0'}); - await buildWebPack('production', [], {'BUNDLE_INDEX': '1'}); - await buildWebPack('production', [], {'BUNDLE_INDEX': '2'}); - await buildWebPack('production', [], {'BUNDLE_INDEX': '3'}); - await buildWebPack('production', [], {'BUNDLE_INDEX': '4'}); + await buildWebPack('production', ['--config', './build/webpack/webpack.config.js'], {'BUNDLE_INDEX': '0'}); + await buildWebPack('production', ['--config', './build/webpack/webpack.config.js'], {'BUNDLE_INDEX': '1'}); + await buildWebPack('production', ['--config', './build/webpack/webpack.config.js'], {'BUNDLE_INDEX': '2'}); + await buildWebPack('production', ['--config', './build/webpack/webpack.config.js'], {'BUNDLE_INDEX': '3'}); + await buildWebPack('production', ['--config', './build/webpack/webpack.config.js'], {'BUNDLE_INDEX': '4'}); // Run both in parallel, for faster process on CI. // Yes, console would print output from both, that's ok, we have a faster CI. // If things fail, we can run locally separately.