При компиляции webpack получаю такую ошибку:
Hash: 58d821e2954fef96ec41
Version: webpack 4.41.0
Time: 3249ms
Built at: 09/27/2019 6:39:50 PM
2 assets
Entrypoint main = main.js main.js.map
[0] ./src/index.tsx 526 bytes {0} [built] [failed] [1 error]
ERROR in ./src/index.tsx
Module build failed (from ./node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for //frontend/src/index.tsx.
at makeSourceMapAndFinish (/frontend/node_modules/ts-loader/dist/index.js:80:15)
at successLoader (/frontend/node_modules/ts-loader/dist/inde
x.js:68:9)
at Object.loader (/frontend/node_modules/ts-loader/dist/index.js:22:12)
ERROR in /frontend/src/react-app-env.ts
[tsl] ERROR in /frontend/src/react-app-env.ts(1,1)
TS1208: All files must be modules when the '--isolatedModules' flag is provided.
Вот мой webpac.config.js
module.exports = {
mode: "production",
entry: './src/index.tsx',
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".ts", ".tsx", ".d.ts"]
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader"
}
]
},
{
enforce: "pre",
test: /\.js$/,
loader: "source-map-loader"
}
]
},
externals: {
"react": "React",
"react-dom": "ReactDOM"
}
};
Вот tsconfig.json
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es6",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCh
eck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
Вот package.json
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@types/jest": "24.0.18",
"@types/node": "12.7.8",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/react": "^16.9.3",
"@types/react-dom": "^16.9.1",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.1.2",
"typescript": "^3.6.3",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9"
}
}
Я вообще хз, что делать.
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Проблема, собственно, описана в заголовке) Ниже мой кодБуду благодарен за любые идеи
Нужен скрипт, который будет установлен на странице indexhtml и будет на странице /$user_id проверять, есть ли там <div id="reverbs5", если да - то применять...
У меня есть много тегов <img> и у некоторых из них вместо data-src="путь/к/картинке" стоит data-lazy="путь/к/картинке", и это ломает lazyload на моем сайте