|
5 | 5 |
|
6 | 6 | //@ts-check
|
7 | 7 |
|
8 |
| -'use strict'; |
| 8 | +"use strict"; |
9 | 9 |
|
10 |
| -const path = require('path'); |
| 10 | +const path = require("path"); |
| 11 | +const ESLintWebpackPlugin = require("eslint-webpack-plugin"); |
11 | 12 |
|
12 | 13 | /**@type {import('webpack').Configuration}*/
|
13 | 14 | const config = {
|
14 |
| - target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ |
15 |
| - node: { |
16 |
| - __dirname: false, |
17 |
| - __filename: false |
18 |
| - }, |
19 |
| - entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ |
20 |
| - output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ |
21 |
| - path: path.resolve(__dirname, 'dist'), |
22 |
| - filename: 'extension.js', |
23 |
| - libraryTarget: "commonjs2", |
24 |
| - devtoolModuleFilenameTemplate: "../[resource-path]", |
25 |
| - }, |
26 |
| - devtool: 'source-map', |
27 |
| - externals: { |
28 |
| - vscode: "commonjs vscode" // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ |
29 |
| - }, |
30 |
| - resolve: { // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader |
31 |
| - extensions: ['.ts', '.js'] |
32 |
| - }, |
33 |
| - module: { |
34 |
| - rules: [{ |
35 |
| - test: /\.ts$/, |
36 |
| - exclude: /node_modules/, |
37 |
| - use: [{ |
38 |
| - loader: 'ts-loader', |
39 |
| - }] |
40 |
| - }] |
41 |
| - }, |
42 |
| -} |
| 15 | + target: "node", // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ |
| 16 | + node: { |
| 17 | + __dirname: false, |
| 18 | + __filename: false, |
| 19 | + }, |
| 20 | + entry: "./src/extension.ts", // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ |
| 21 | + output: { |
| 22 | + // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ |
| 23 | + path: path.resolve(__dirname, "dist"), |
| 24 | + filename: "extension.js", |
| 25 | + libraryTarget: "commonjs2", |
| 26 | + devtoolModuleFilenameTemplate: "../[resource-path]", |
| 27 | + }, |
| 28 | + devtool: "source-map", |
| 29 | + externals: { |
| 30 | + vscode: "commonjs vscode", // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/ |
| 31 | + }, |
| 32 | + resolve: { |
| 33 | + // support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader |
| 34 | + extensions: [".ts", ".js"], |
| 35 | + }, |
| 36 | + module: { |
| 37 | + rules: [ |
| 38 | + { |
| 39 | + test: /\.ts$/, |
| 40 | + exclude: /node_modules/, |
| 41 | + use: [ |
| 42 | + { |
| 43 | + loader: "ts-loader", |
| 44 | + }, |
| 45 | + ], |
| 46 | + }, |
| 47 | + ], |
| 48 | + }, |
| 49 | + plugins: [ |
| 50 | + new ESLintWebpackPlugin({ |
| 51 | + extensions: [".ts", ".js"], |
| 52 | + }), |
| 53 | + ], |
| 54 | + infrastructureLogging: { |
| 55 | + level: "log", |
| 56 | + }, |
| 57 | +}; |
43 | 58 |
|
44 | 59 | module.exports = config;
|
0 commit comments