Skip to content

Commit

Permalink
🧑‍💻 Switch to module and ES6 imports for webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Oct 6, 2024
1 parent c32224f commit c80aec3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
10 changes: 5 additions & 5 deletions bin/webpack.bookmarklet.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const BUILD = require('../.build.json');
const TerserPlugin = require('terser-webpack-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const webpack = require('webpack');
import BUILD from '../.build.json' assert { type: 'json' };
import TerserPlugin from 'terser-webpack-plugin';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import webpack from 'webpack';

module.exports = {
export default {
entry: {
bookmarkletFilter: './src/script/mainBookmarklet.ts',
},
Expand Down
8 changes: 4 additions & 4 deletions bin/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const BUILD = require('../.build.json');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const webpack = require('webpack');
import BUILD from '../.build.json' assert { type: 'json' };
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import webpack from 'webpack';

module.exports = {
export default {
entry: {
background: './src/script/mainBackground.ts',
optionPage: './src/script/mainOptionPage.ts',
Expand Down
6 changes: 3 additions & 3 deletions bin/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
import { merge } from 'webpack-merge';
import common from './webpack.common.js';

module.exports = merge(common, {
export default merge(common, {
devtool: 'inline-source-map',
});
6 changes: 3 additions & 3 deletions bin/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
import { merge } from 'webpack-merge';
import common from './webpack.common.js';

module.exports = merge(common, {
export default merge(common, {
output: {
clean: false,
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "git",
"url": "git+https://github.com/FrostCo/AdvancedProfanityFilter.git"
},
"type": "module",
"keywords": [
"Profanity",
"Filter"
Expand Down

0 comments on commit c80aec3

Please sign in to comment.