diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-06-01 21:13:43 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-06-01 21:13:43 +0200 |
| commit | 9383a2fb09ffb60cfe63683106945bd688affa59 (patch) | |
| tree | 65b3f4b48841583e355887db5de5a16e7005fc87 /src/wwwroot/webpack.config.js | |
| download | vinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.tar.xz vinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.zip | |
feat: Initial commit after clean slate
Diffstat (limited to 'src/wwwroot/webpack.config.js')
| -rw-r--r-- | src/wwwroot/webpack.config.js | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/src/wwwroot/webpack.config.js b/src/wwwroot/webpack.config.js new file mode 100644 index 0000000..2ab3436 --- /dev/null +++ b/src/wwwroot/webpack.config.js @@ -0,0 +1,156 @@ +const path = require("path"); +const globImporter = require("node-sass-glob-importer"); + +module.exports = [ + { + mode: "development", + entry: ["./frontbundle.js", "./frontbundle.scss"], + watch: (process.argv.indexOf("--watch") > -1), + watchOptions: { + ignored: /node_modules/, + }, + module: { + rules: [ + { + test: /\.ts?$/, + exclude: /node_modules/, + use: "ts-loader", + }, + { + test: /\.svg$/, + use: [{ + loader: "html-loader", + options: { + minimize: true, + }, + }], + }, + { + test: /\.(css|scss)$/i, + use: [ + { + loader: "file-loader", + options: { + name: "[name].css", + }, + }, + { + loader: "extract-loader", + }, + { + loader: "css-loader?-url", + }, + { + loader: "postcss-loader", + options: { + postcssOptions: { + plugins: ["autoprefixer"], + }, + }, + }, + { + loader: "sass-loader", + options: { + sourceMap: true, + sassOptions: { + outputStyle: "compressed", + importer: globImporter(), + }, + }, + }, + ], + }, + ], + }, + resolve: { + extensions: [".ts", ".js", ".scss", ".css"], + }, + devtool: "source-map", + output: { + filename: "frontbundle.min.js", + path: path.resolve(__dirname, "dist"), + }, + }, + { + mode: "development", + entry: ["./backbundle.js", "./backbundle.scss"], + watch: (process.argv.indexOf("--watch") > -1), + watchOptions: { + ignored: /node_modules/, + }, + module: { + rules: [ + { + test: /\.ts$/, + use: [{ + loader: "ts-loader", + options: { + compilerOptions: { + declaration: false, + target: "es5", + module: "commonjs", + }, + transpileOnly: true, + }, + }], + }, + { + test: /\.svg$/, + use: [{ + loader: "html-loader", + options: { + minimize: true, + }, + }], + }, + { + test: /\.(css|scss)$/i, + use: [ + { + loader: "file-loader", + options: { + name: "[name].css", + }, + }, + { + loader: "extract-loader", + }, + { + loader: "css-loader?-url", + }, + { + loader: "postcss-loader", + options: { + postcssOptions: { + plugins: ["autoprefixer"], + }, + }, + }, + { + loader: "sass-loader", + options: { + sourceMap: true, + sassOptions: { + outputStyle: "compressed", + importer: globImporter(), + }, + }, + }, + ], + }, + ], + }, + resolve: { + extensions: [".ts", ".js", ".scss", ".css"], + alias: { + "parchment": path.resolve(__dirname, "node_modules/parchment/src/parchment.ts"), + "quill$": path.resolve(__dirname, "node_modules/quill/quill.js"), + }, + }, + devtool: "source-map", + output: { + filename: "backbundle.min.js", + path: path.resolve(__dirname, "dist"), + }, + }, +];
\ No newline at end of file |
