From 2a8fb8f661f53206d9f6fb51c29fd22659b4f653 Mon Sep 17 00:00:00 2001 From: dranc Date: Wed, 3 Jan 2024 22:10:08 +0100 Subject: [PATCH] try to clean webpack --- config/webpack.config.js | 14 +++++++++++--- src/asset/html/index.html | 6 +++--- src/asset/style/index.scss | 2 +- src/index.ts | 2 -- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/config/webpack.config.js b/config/webpack.config.js index 9844c47..bec4f54 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -12,21 +12,29 @@ const config = merge(common, { contentScript: PATHS.src + '/contentScript.ts', background: PATHS.src + '/background.ts', index: PATHS.src + '/index.ts', + style: PATHS.src + '/asset/style/index.scss' }, resolve: { extensions: ['.tsx', '.ts', '.js'], }, module: { rules: [ - { + { test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/, }, { test: /\.s[ac]ss$/i, - use: ['style-loader', 'css-loader', 'sass-loader'], - }, + exclude: /node_modules/, + use: [ + { + loader: 'file-loader', + options: { outputPath: 'style/', name: '[name].min.css'} + }, + 'sass-loader' + ] + } ], }, }); diff --git a/src/asset/html/index.html b/src/asset/html/index.html index a2bab91..3c3543b 100644 --- a/src/asset/html/index.html +++ b/src/asset/html/index.html @@ -1,11 +1,11 @@ - + @@ -32,6 +32,6 @@ - + diff --git a/src/asset/style/index.scss b/src/asset/style/index.scss index f7fccde..0dd1af0 100644 --- a/src/asset/style/index.scss +++ b/src/asset/style/index.scss @@ -1,4 +1,4 @@ -@import url('~picnic/picnic.min.css'); +@import '~picnic/src/picnic'; $height: 500px; $width: 350px; diff --git a/src/index.ts b/src/index.ts index 97f6bed..2559aed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,3 @@ -import './asset/style/index.scss'; - import { saveAs } from 'file-saver'; import { FiligraneServices } from './services/filigrane.services';