Add raw loader for scss

This commit is contained in:
a 2020-07-31 00:29:40 +02:00
parent feb9177f92
commit 4ca87d0f15
4 changed files with 23 additions and 4 deletions

View file

@ -15,6 +15,7 @@
"husky": ">=4", "husky": ">=4",
"lint-staged": ">=10", "lint-staged": ">=10",
"prettier": "^2.0.5", "prettier": "^2.0.5",
"raw-loader": "^4.0.1",
"sass": "^1.26.10", "sass": "^1.26.10",
"sass-loader": "^9.0.2", "sass-loader": "^9.0.2",
"style-loader": "^1.2.1", "style-loader": "^1.2.1",

5
src/types.d.ts vendored
View file

@ -1,3 +1,8 @@
declare module "*.raw" {
const content: string;
export = content;
}
declare const enum commands { declare const enum commands {
setEnabled = "toggleCommand", setEnabled = "toggleCommand",
getEnabled = "getEnabled", getEnabled = "getEnabled",

View file

@ -10,7 +10,12 @@ let mode = process.env.NODE_ENV || "development";
let options = { let options = {
entry: { entry: {
popup: path.join(__dirname, "src", "popup", "popup.ts"), popup: path.join(__dirname, "src", "popup", "popup.ts"),
content_script: path.join(__dirname, "src", "content_script.ts"), content_script: path.join(
__dirname,
"src",
"content_script",
"content_script.ts"
),
background: path.join(__dirname, "src", "background.ts"), background: path.join(__dirname, "src", "background.ts"),
}, },
output: { output: {
@ -35,11 +40,11 @@ let options = {
exclude: /node_modules/, exclude: /node_modules/,
}, },
{ {
test: /\.css$/i, test: /\.(c|s[ac])ss\.raw$/i,
use: ["style-loader", "css-loader"], use: ["raw-loader", "sass-loader"],
}, },
{ {
test: /\.s[ac]ss$/i, test: /\.(c|s[ac])ss$/i,
use: ["style-loader", "css-loader", "sass-loader"], use: ["style-loader", "css-loader", "sass-loader"],
}, },
], ],

View file

@ -5038,6 +5038,14 @@ randomfill@^1.0.3:
randombytes "^2.0.5" randombytes "^2.0.5"
safe-buffer "^5.1.0" safe-buffer "^5.1.0"
raw-loader@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.1.tgz#14e1f726a359b68437e183d5a5b7d33a3eba6933"
integrity sha512-baolhQBSi3iNh1cglJjA0mYzga+wePk7vdEX//1dTFd+v4TsQlQE0jitJSNF1OIP82rdYulH7otaVmdlDaJ64A==
dependencies:
loader-utils "^2.0.0"
schema-utils "^2.6.5"
rc@^1.2.8: rc@^1.2.8:
version "1.2.8" version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"