Refactor background page to use Typescript
Also, this CL adds clean-terminal-webpack-plugin to make it easier to
debug Typescript errors while developing the extension.
Bug: translateselectedtext:15
Change-Id: If9b97cb7508859e2e05f5dc82940808fd935bf1a
diff --git a/webpack.config.js b/webpack.config.js
index 0e620ad..239fc73 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,6 @@
const path = require('path');
const json5 = require('json5');
+const CleanTerminalPlugin = require('clean-terminal-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const WebpackShellPluginNext = require('webpack-shell-plugin-next');
@@ -7,7 +8,7 @@
// NOTE: When adding an entry, add the corresponding source map file to
// web_accessible_resources in //templates/manifest.gjson.
let entry = {
- background: './src/background.js',
+ background: './src/background.ts',
options: './src/options/options.js',
};
@@ -58,6 +59,7 @@
},
]
}),
+ new CleanTerminalPlugin(),
],
devtool: (args.mode == 'production' ? 'source-map' : 'inline-source-map'),
resolve: {