refactor: use webpack to compile and package
This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -7,7 +7,7 @@
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
|
||||
"preLaunchTask": "tsc: build - tsconfig.json",
|
||||
"sourceMaps": true,
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
},
|
||||
{
|
||||
|
14
package.json
14
package.json
@@ -90,17 +90,11 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "webpack --mode production",
|
||||
"compile": "webpack --mode production",
|
||||
"vscode:package": "webpack --mode production && vsce package",
|
||||
"vscode:prepublish": "npm run package",
|
||||
"compile": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"package": "webpack --mode production --devtool hidden-source-map",
|
||||
"compile-tests": "tsc -p . --outDir out",
|
||||
"watch-tests": "tsc -p . -w --outDir out",
|
||||
"pretest": "npm run compile-tests && npm run compile && npm run lint",
|
||||
"lint": "eslint src --ext ts",
|
||||
"test": "vscode-test"
|
||||
"vscode:publish": "vsce publish",
|
||||
"watch": "webpack --mode production --watch",
|
||||
"lint": "eslint src --ext ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-plus": "~3.1.1",
|
||||
|
@@ -15,7 +15,7 @@ externals.push('vscode');
|
||||
|
||||
module.exports = {
|
||||
mode: 'production',
|
||||
entry: __dirname + '/src/main.js',
|
||||
entry: __dirname + '/src/main.ts',
|
||||
output: {
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
filename: 'extension.js',
|
||||
@@ -27,14 +27,14 @@ module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
test: /\.ts$/,
|
||||
loader: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
modules: [path.resolve('./node_modules'), path.resolve('./src')],
|
||||
extensions: ['.js']
|
||||
extensions: ['.ts', '.js']
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user