diff --git a/.vscodeignore b/.vscodeignore index 45da1c6..6e7285f 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,4 +1,3 @@ -.config/** .vscode/** .vscode-test/** out/test/** @@ -9,3 +8,4 @@ tsconfig.json vsc-extension-quickstart.md tslint.json node_modules/ +webpack.config.json diff --git a/package-lock.json b/package-lock.json index d660df2..7068c43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1011,6 +1011,15 @@ } } }, + "clean-webpack-plugin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-1.0.1.tgz", + "integrity": "sha512-gvwfMsqu3HBgTVvaBa1H3AZKO03CHpr5uP92SPIktP3827EovAitwW+1xoqXyTxCuXnLYpMHG5ytS4AoukHDWA==", + "dev": true, + "requires": { + "rimraf": "^2.6.1" + } + }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", diff --git a/package.json b/package.json index ded0542..593a3e1 100644 --- a/package.json +++ b/package.json @@ -181,27 +181,23 @@ } }, "scripts": { - "vscode:prepublish": "npm run compile:prod", - "compile:tsc": "tsc -p ./", - "watch:tsc": "tsc -watch -p ./", - "compile:prod": "webpack --config webpack.config.js --mode production", - "compile": "webpack --config webpack.config.js --mode development", - "watch": "webpack --config webpack.config.js", + "vscode:prepublish": "webpack --config webpack.config.js --mode production", + "compile": "tsc -p ./", + "watch": "tsc -watch -p ./", "postinstall": "node ./node_modules/vscode/bin/install", "test": "npm run compile && node ./node_modules/vscode/bin/test" }, "devDependencies": { - "@types/mocha": "^2.2.42", "@types/keytar": "^4.0.1", + "@types/mocha": "^2.2.42", "@types/node": "^8.10.39", - "vscode": "^1.1.26", + "clean-webpack-plugin": "^1.0.1", + "ts-loader": "^5.3.3", "tslint": "^5.8.0", "typescript": "^2.6.1", + "vscode": "^1.1.26", "webpack": "^4.29.4", - "webpack-cli": "^3.2.3", - "ts-loader": "^5.3.3", - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "webpack-cli": "^3.2.3" }, "dependencies": { "twitch-js": "^1.2.17", diff --git a/tsconfig.json b/tsconfig.json index 9ea5934..173ca8c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "lib": [ "es6" ], - // sourceMap": true, + "sourceMap": true, "rootDir": "src", /* Strict Type-Checking Option */ "strict": true /* enable all strict type-checking options */, diff --git a/webpack.config.js b/webpack.config.js index f65e221..013b34f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,7 @@ 'use strict'; const path = require('path'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); module.exports = { target: 'node', @@ -9,6 +10,9 @@ module.exports = { twitchLanguageServer: './src/twitchLanguageServer.ts', }, devtool: 'source-map', + plugins: [ + new CleanWebpackPlugin(['out']) + ], module: { rules: [ {