mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
feat: use awesome-typescript-loader for js, ts, tsx files
This commit is contained in:
parent
f64ee4ca96
commit
7087c526ef
@ -7,6 +7,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const WriteWebpackPlugin = require('write-webpack-plugin');
|
const WriteWebpackPlugin = require('write-webpack-plugin');
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
|
const { CheckerPlugin } = require('awesome-typescript-loader');
|
||||||
const ExtensionReloader = require('webpack-extension-reloader');
|
const ExtensionReloader = require('webpack-extension-reloader');
|
||||||
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
|
const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries');
|
||||||
|
|
||||||
@ -66,22 +67,9 @@ module.exports = {
|
|||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /.(js|jsx)$/,
|
test: /\.(js|ts|tsx)?$/,
|
||||||
include: [path.resolve(__dirname, 'src/scripts')],
|
loader: 'awesome-typescript-loader',
|
||||||
loader: 'babel-loader',
|
exclude: /node_modules/,
|
||||||
|
|
||||||
options: {
|
|
||||||
plugins: ['syntax-dynamic-import'],
|
|
||||||
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@babel/preset-env',
|
|
||||||
{
|
|
||||||
modules: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.scss$/,
|
test: /\.scss$/,
|
||||||
@ -118,6 +106,8 @@ module.exports = {
|
|||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.ProgressPlugin(),
|
new webpack.ProgressPlugin(),
|
||||||
|
// for awesome-typescript-loader
|
||||||
|
new CheckerPlugin(),
|
||||||
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/518
|
// https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/518
|
||||||
new FixStyleOnlyEntriesPlugin({ silent: true }),
|
new FixStyleOnlyEntriesPlugin({ silent: true }),
|
||||||
new webpack.EnvironmentPlugin(['NODE_ENV', 'TARGET_BROWSER']),
|
new webpack.EnvironmentPlugin(['NODE_ENV', 'TARGET_BROWSER']),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user