mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Started conversion to TypeScript.
This commit is contained in:
43
webpack/webpack.common.js
Normal file
43
webpack/webpack.common.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const webpack = require("webpack");
|
||||
const path = require('path');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const srcDir = '../src/';
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
popup: path.join(__dirname, srcDir + 'popup.ts'),
|
||||
background: path.join(__dirname, srcDir + 'background.ts'),
|
||||
content_script: path.join(__dirname, srcDir + 'content_script.ts')
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, '../dist/js'),
|
||||
filename: '[name].js'
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: {
|
||||
name: 'vendor',
|
||||
chunks: "initial"
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
exclude: /node_modules/
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js']
|
||||
},
|
||||
plugins: [
|
||||
// exclude locale files in moment
|
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||
new CopyPlugin([
|
||||
{ from: '.', to: '../' }
|
||||
],
|
||||
{context: 'public' }
|
||||
),
|
||||
]
|
||||
};
|
||||
7
webpack/webpack.dev.js
Normal file
7
webpack/webpack.dev.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const merge = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
devtool: 'inline-source-map',
|
||||
mode: 'development'
|
||||
});
|
||||
6
webpack/webpack.prod.js
Normal file
6
webpack/webpack.prod.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const merge = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production'
|
||||
});
|
||||
Reference in New Issue
Block a user