Я использую машинопись с awesome-typescript-загрузчиком и Webpack для компиляции Но в IE11 это не работает. У меня есть эта ошибка.
SCRIPT1014
bundle.js (58458,12)
И в этом ряду у меня есть это. Я думаю, что проблема в характере `
const v6 = `
А это моя конфигурация tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "es6",
"moduleResolution": "node",
"resolveJsonModule": true,
"declaration": false,
"esModuleInterop": true,
"noImplicitAny": false,
"jsx": "react",
"sourceMap": true,
"noLib": false,
"suppressImplicitAnyIndexErrors": true,
"baseUrl": "./src/",
"paths": {
"@pages": ["./pages/*"],
"@core": ["./core/*"],
"@pods": ["./pods/*"],
"@common": ["./common/*"],
"@state": ["./state/*"]
},
"skipLibCheck": true
},
"compileOnSave": false,
"exclude": ["node_modules"]
}
А это мой webpack.config.js
var HtmlWebpackPlugin = require("html-webpack-plugin");
var MiniCssExtractPlugin = require("mini-css-extract-plugin");
var webpack = require("webpack");
var path = require("path");
var basePath = __dirname;
module.exports = {
context: path.join(basePath, "src"),
resolve: {
extensions: [".js", ".ts", ".tsx"],
alias: {
// Later on we will add more aliases here
pages: path.resolve(__dirname, "./src/pages/"),
core: path.resolve(__dirname, "./src/core/"),
pods: path.resolve(__dirname, "./src/pods/"),
common: path.resolve(__dirname, "./src/common/"),
state: path.resolve(__dirname, "./src/state/"),
}
},
entry: ["@babel/polyfill", "./index.tsx"],
output: {
path: path.join(basePath, "dist"),
filename: "bundle.js"
},
devtool: "source-map",
devServer: {
contentBase: "./dist", // Content base
inline: true, // Enable watch and live reload
host: "test",
port: 8080,
stats: "errors-only",
disableHostCheck: true,
historyApiFallback: true,
},
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: "awesome-typescript-loader",
options: {
useBabel: true,
babelCore: "@babel/core" // needed for Babel v7
}
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader",
options: {
name: "assets/img/[name].[ext]?[hash]"
}
}
]
},
plugins: [
//Generate index.html in /dist => https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: "index.html", //Name of file in ./dist/
template: "index.html", //Name of template in ./src
hash: true
}),
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
})
]
};
и .babelrc file
{
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "entry"
}
]
]
}
У меня нет больше идей об этой проблеме.