Use Babel instead of ts-loader
parent
f0d699d727
commit
5e28c4c421
File diff suppressed because it is too large
Load Diff
|
@ -39,6 +39,9 @@
|
|||
},
|
||||
"homepage": "https://gitlab.com/renewedtab/renewedtab#readme",
|
||||
"dependencies": {
|
||||
"@babel/plugin-transform-react-jsx": "^7.17.3",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.36",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
||||
"@sentry/node": "^6.16.1",
|
||||
|
@ -50,9 +53,12 @@
|
|||
"@types/react-dom": "^17.0.11",
|
||||
"@types/react-grid-layout": "^1.3.0",
|
||||
"@types/react-radio-group": "^3.0.4",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-formatjs": "^10.3.18",
|
||||
"copy-webpack-plugin": "^10.2.0",
|
||||
"css-loader": "^6.5.1",
|
||||
"express": "^4.17.2",
|
||||
"fork-ts-checker-webpack-plugin": "^7.2.1",
|
||||
"git-revision-webpack-plugin": "^5.0.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"mini-css-extract-plugin": "^2.5.2",
|
||||
|
@ -67,7 +73,6 @@
|
|||
"react-intl": "^5.24.3",
|
||||
"react-radio-group": "^3.0.3",
|
||||
"sass-loader": "^12.4.0",
|
||||
"ts-loader": "^9.2.6",
|
||||
"typescript": "^4.5.4",
|
||||
"webpack": "^5.66.0",
|
||||
"webpack-cli": "^4.9.1"
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2015"
|
||||
},
|
||||
"exclude": [
|
||||
"src/server",
|
||||
"tests"
|
||||
|
|
|
@ -4,7 +4,7 @@ const fs = require("fs");
|
|||
const CopyPlugin = require("copy-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const formatjs = require("@formatjs/ts-transformer");
|
||||
const ForkTsCheckerPlugin = require('fork-ts-checker-webpack-plugin');
|
||||
const {GitRevisionPlugin} = require('git-revision-webpack-plugin');
|
||||
const gitRevisionPlugin = new GitRevisionPlugin({
|
||||
lightweightTags: true,
|
||||
|
@ -76,29 +76,49 @@ module.exports = {
|
|||
"webext": true,
|
||||
},
|
||||
}),
|
||||
new ForkTsCheckerPlugin({
|
||||
typescript: {
|
||||
configFile: path.resolve(__dirname, "tsconfig.app.json"),
|
||||
},
|
||||
// eslint: {
|
||||
// files: './**/*.{ts,tsx}',
|
||||
// },
|
||||
}),
|
||||
],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: [
|
||||
{
|
||||
loader: "ts-loader",
|
||||
options: {
|
||||
configFile: "tsconfig.app.json",
|
||||
getCustomTransformers() {
|
||||
return {
|
||||
before: [
|
||||
formatjs.transform({
|
||||
overrideIdFn: '[sha512:contenthash:base64:6]',
|
||||
}),
|
||||
],
|
||||
};
|
||||
test: /\.[t|j]sx?$/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
babelrc: false,
|
||||
cacheDirectory: true,
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-typescript',
|
||||
{
|
||||
isTSX: true,
|
||||
allExtensions: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
exclude: /node_modules/,
|
||||
],
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
targets: { browsers: ['Chrome 96'] },
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: [
|
||||
'@babel/transform-react-jsx',
|
||||
[
|
||||
"formatjs",
|
||||
{
|
||||
"idInterpolationPattern": "[sha512:contenthash:base64:6]",
|
||||
"ast": true
|
||||
}
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.s?[ac]ss$/i,
|
||||
|
|
Loading…
Reference in New Issue