NR
сss-in-js это парадигма в которой позволено описать css стили напрямую или посредственно синтаксисом валидным в мире js.
Как jsx только для css
Будет из этого сгенерирован файл или инлайн стиль зависит от конкретной реализации
Size: a a a
NR
y
<script />
<style />
Component
StyledComponent
A
<script />
<style />
Component
StyledComponent
A
KS
K✔
ERROR in ./extension.ts 16:53
Module parse failed: Unexpected token (16:53)
File was processed with these loaders:
* ../../node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
| chrome.tabs.getCurrent((tab) => {
| console.info("%c%s", "color: #D73B02", `Create a tab for Office file with id: ${tab.id}`);
> state.officeOnline.fileUrl = tab?.url;
| });
| state.downloader.allowDownload = false;
@ ./index.ts 1:0-40 2:22-31
const path = require('path');
module.exports = {
entry: './index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
include: __dirname,
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
filename: 'extension.js',
path: path.resolve('../../dist/prevent-download-and-view-online/extension'),
},
};
{
"compilerOptions": {
"moduleResolution": "Node",
"removeComments": true,
"module": "ES2020",
"rootDir": ".",
"outDir": "../../dist/prevent-download-and-view-online/extension",
"target": "ES2020",
"declaration": false,
"incremental": true,
"sourceMap": false
}
}
K✔
ERROR in ./extension.ts 16:53
Module parse failed: Unexpected token (16:53)
File was processed with these loaders:
* ../../node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
| chrome.tabs.getCurrent((tab) => {
| console.info("%c%s", "color: #D73B02", `Create a tab for Office file with id: ${tab.id}`);
> state.officeOnline.fileUrl = tab?.url;
| });
| state.downloader.allowDownload = false;
@ ./index.ts 1:0-40 2:22-31
const path = require('path');
module.exports = {
entry: './index.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
include: __dirname,
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
filename: 'extension.js',
path: path.resolve('../../dist/prevent-download-and-view-online/extension'),
},
};
{
"compilerOptions": {
"moduleResolution": "Node",
"removeComments": true,
"module": "ES2020",
"rootDir": ".",
"outDir": "../../dist/prevent-download-and-view-online/extension",
"target": "ES2020",
"declaration": false,
"incremental": true,
"sourceMap": false
}
}
tsconfig.json
поменять target
на ES2019
, то всё будет гуд
y
y
const cssLoader = {
loader: 'css-loader',
options: {
modules: {
mode: 'local',
localIdentName: '[contenthash:3]'
}
}
}
y
IB