UNPKG

761 BJavaScriptView Raw
1const path = require('path');
2const ClosureCompilerPlugin = require('webpack-closure-compiler');
3
4module.exports = {
5 mode: 'production',
6 entry: path.resolve(__dirname, './minimal.ts'),
7 output: {
8 path: path.resolve(__dirname, './'),
9 library: 'minimal.js',
10 libraryTarget: 'umd',
11 filename: 'minimal.js'
12 },
13 resolve: {
14 extensions: ['.ts', '.tsx', '.js']
15 },
16 module: {
17 rules: [
18 // files with `.ts` or `.tsx` extension will be handled by `ts-loader`
19 { test: /\.tsx?$/, loader: 'ts-loader' }
20 ]
21 },
22 stats: 'errors-only',
23 plugins: [
24 new ClosureCompilerPlugin({
25 compiler: {
26 language_out: 'ECMASCRIPT5',
27 process_common_js_modules: true,
28 }
29 })
30 ]
31}