Skip to content

Commit

Permalink
Update to new renderer API and update webpack from 4 => 5 (#46)
Browse files Browse the repository at this point in the history
Build appears good on AzDO so pushing admin
  • Loading branch information
IanMatthewHuff authored May 23, 2021
1 parent 2fbe916 commit f245b5a
Show file tree
Hide file tree
Showing 4 changed files with 1,519 additions and 4,548 deletions.
27 changes: 21 additions & 6 deletions build/webpack/webpack.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the MIT License.

const common = require('./common');
const FixDefaultImportPlugin = require('webpack-fix-default-import-plugin');
const path = require('path');
const constants = require('../constants');
const configFileName = 'src/client/tsconfig.json';
const { DefinePlugin } = require('webpack');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
// Any build on the CI is considered production mode.
const isProdBuild = constants.isCI || process.argv.some((argv) => argv.includes('mode') && argv.includes('production'));
Expand All @@ -18,21 +18,25 @@ module.exports = {
output: {
path: path.join(constants.ExtensionRootDir, 'out', 'client_renderer'),
filename: '[name].js',
chunkFilename: `[name].bundle.js`
chunkFilename: `[name].bundle.js`,
libraryTarget: 'module'
},
experiments: {
outputModule: true
},
target: 'node',
mode: isProdBuild ? 'production' : 'development',
devtool: isProdBuild ? 'source-map' : 'inline-source-map',
node: {
fs: 'empty'
},
plugins: [
new FixDefaultImportPlugin(),
new ForkTsCheckerWebpackPlugin({
checkSyntacticErrors: true,
tsconfig: configFileName,
reportFiles: ['src/client/**/*.{ts,tsx}'],
memoryLimit: 9096
}),
new DefinePlugin({
scriptUrl: 'import.meta.url'
}),
...common.getDefaultPlugins('extension')
],
stats: {
Expand All @@ -42,6 +46,9 @@ module.exports = {
hints: false
},
resolve: {
fallback: {
fs: false
},
extensions: ['.ts', '.tsx', '.js', '.json', '.svg']
},
module: {
Expand Down Expand Up @@ -112,6 +119,14 @@ module.exports = {
{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader']
},
{
test: /\.node$/,
use: [
{
loader: 'node-loader'
}
]
}
]
}
Expand Down
Loading

0 comments on commit f245b5a

Please sign in to comment.