Use webpack.
This commit is contained in:
parent
43e1e63bf8
commit
59168bf3bf
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
|
@ -16,24 +16,27 @@
|
||||||
"icon": "assets/texinfo.png",
|
"icon": "assets/texinfo.png",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^14.14.6",
|
"@types/node": "^14.14.6",
|
||||||
|
"@types/terser-webpack-plugin": "^5.0.1",
|
||||||
"@types/vscode": "^1.50.0",
|
"@types/vscode": "^1.50.0",
|
||||||
|
"@types/webpack": "^4.41.24",
|
||||||
"@typescript-eslint/eslint-plugin": "^3.8.0",
|
"@typescript-eslint/eslint-plugin": "^3.8.0",
|
||||||
"@typescript-eslint/parser": "^3.8.0",
|
"@typescript-eslint/parser": "^3.8.0",
|
||||||
"cson": "^7.20.0",
|
"cson": "^7.20.0",
|
||||||
"eslint": "^7.12.1",
|
"eslint": "^7.12.1",
|
||||||
"language-texinfo": "^1.0.0",
|
"language-texinfo": "^1.0.0",
|
||||||
"typescript": "^4.0.5"
|
"node-html-parser": "^1.4.5",
|
||||||
},
|
"ts-loader": "^8.0.7",
|
||||||
"dependencies": {
|
"ts-node": "^9.0.0",
|
||||||
"node-html-parser": "^1.4.3"
|
"typescript": "^4.0.5",
|
||||||
|
"webpack": "^5.3.2",
|
||||||
|
"webpack-cli": "^4.1.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"vscode:prepublish": "npm run lint && npm run build",
|
"vscode:prepublish": "webpack --mode production",
|
||||||
"compile": "tsc -p ./",
|
"build": "webpack --mode development",
|
||||||
"prepare": "sh ./scripts/prepare.sh",
|
"prepare": "sh ./scripts/prepare.sh",
|
||||||
"build": "npm run prepare && npm run compile",
|
|
||||||
"lint": "eslint --ext ts --fix src",
|
"lint": "eslint --ext ts --fix src",
|
||||||
"watch": "tsc -watch -p ./"
|
"watch": "webpack --mode development --watch"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
"lib": [
|
"lib": [
|
||||||
"ES2019"
|
"ES2019"
|
||||||
],
|
],
|
||||||
|
"esModuleInterop": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
|
@ -14,6 +15,6 @@
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
".vscode-test"
|
"*.config.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as webpack from 'webpack';
|
||||||
|
|
||||||
|
const config: webpack.Configuration = {
|
||||||
|
target: 'node',
|
||||||
|
entry: './src/extension.ts',
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'out'),
|
||||||
|
filename: 'extension.js',
|
||||||
|
libraryTarget: 'commonjs2',
|
||||||
|
devtoolModuleFilenameTemplate: '../[resource-path]',
|
||||||
|
},
|
||||||
|
devtool: 'source-map',
|
||||||
|
optimization: {
|
||||||
|
concatenateModules: true,
|
||||||
|
innerGraph: true,
|
||||||
|
mergeDuplicateChunks: true,
|
||||||
|
mangleExports: true,
|
||||||
|
minimize: true,
|
||||||
|
},
|
||||||
|
externals: {
|
||||||
|
vscode: 'commonjs vscode',
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ['.js', '.ts'],
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.ts$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'ts-loader',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
Loading…
Reference in New Issue