diff --git a/Props/assets/js/main.js b/Props/assets/js/site-wide.js similarity index 72% rename from Props/assets/js/main.js rename to Props/assets/js/site-wide.js index d99f6b9..f490be1 100644 --- a/Props/assets/js/main.js +++ b/Props/assets/js/site-wide.js @@ -1,5 +1,2 @@ - - -// Site-wide JS imports: import "~/node_modules/bootstrap/js/dist/collapse"; import "simplebar"; diff --git a/Props/assets/scss/_themer.scss b/Props/assets/styles/_themer.scss similarity index 100% rename from Props/assets/scss/_themer.scss rename to Props/assets/styles/_themer.scss diff --git a/Props/assets/scss/_variables.scss b/Props/assets/styles/_variables.scss similarity index 100% rename from Props/assets/scss/_variables.scss rename to Props/assets/styles/_variables.scss diff --git a/Props/assets/styles/dependencies.css b/Props/assets/styles/dependencies.css new file mode 100644 index 0000000..9a1ac23 --- /dev/null +++ b/Props/assets/styles/dependencies.css @@ -0,0 +1,2 @@ +@import "~/node_modules/bootstrap-icons/font/bootstrap-icons.css"; +@import "~/node_modules/simplebar/dist/simplebar.min.css"; \ No newline at end of file diff --git a/Props/assets/scss/main.scss b/Props/assets/styles/site-wide.scss similarity index 93% rename from Props/assets/scss/main.scss rename to Props/assets/styles/site-wide.scss index 12d0d03..572bae7 100644 --- a/Props/assets/scss/main.scss +++ b/Props/assets/styles/site-wide.scss @@ -116,9 +116,4 @@ body { background-color: themer.color-of("background"); color: themer.color-of("text"); } -} - - -// Site-wide css imports: -@import "~/node_modules/bootstrap-icons/font/bootstrap-icons.css"; -@import "~/node_modules/simplebar/dist/simplebar.min.css"; +} \ No newline at end of file diff --git a/Props/package-lock.json b/Props/package-lock.json index bc5601f..db9bc2f 100644 --- a/Props/package-lock.json +++ b/Props/package-lock.json @@ -2000,9 +2000,9 @@ } }, "css-loader": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.1.0.tgz", - "integrity": "sha512-AcCb6ire7NgkrxJCtwEDa/y+xxBrPNXYWdlSpXNr+YwW2wTahSowSIxD9cHc9Uvc8Dbq+NQ/NQ6aDvJWik44vg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.2.0.tgz", + "integrity": "sha512-/rvHfYRjIpymZblf49w8jYcRo2y9gj6rV8UroHGmBxKrIyGLokpycyKzp9OkitvqT29ZSpzJ0Ic7SpnJX3sC8g==", "dev": true, "requires": { "icss-utils": "^5.1.0", @@ -3137,9 +3137,9 @@ } }, "postcss": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.5.tgz", - "integrity": "sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", "dev": true, "requires": { "colorette": "^1.2.2", @@ -3583,9 +3583,9 @@ "dev": true }, "style-loader": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.1.0.tgz", - "integrity": "sha512-HYVvBMX3RX7zx71pquZV6EcnPN7Deba+zQteSxCLqt3bxYRphmeMr+2mZMrIZjZ7IMa6aOUhNGn8cXGvWMjClw==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.2.1.tgz", + "integrity": "sha512-1k9ZosJCRFaRbY6hH49JFlRB0fVSbmnyq1iTPjNxUmGVjBNEmwrrHPenhlp+Lgo51BojHSf6pl2FcqYaN3PfVg==", "dev": true }, "style-value-types": { diff --git a/Props/package.json b/Props/package.json index f627a79..46c03ad 100644 --- a/Props/package.json +++ b/Props/package.json @@ -17,12 +17,12 @@ "babel-eslint": "^10.1.0", "babel-loader": "^8.2.2", "copy-webpack-plugin": "^9.0.1", - "css-loader": "^6.1.0", + "css-loader": "^6.2.0", "eslint": "^7.31.0", "glob": "^7.1.7", "sass": "^1.35.2", "sass-loader": "^12.1.0", - "style-loader": "^3.1.0", + "style-loader": "^3.2.1", "webpack": "^5.45.1", "webpack-cli": "^4.7.2", "webpack-merge": "^5.8.0" @@ -35,4 +35,4 @@ "popmotion": "^9.4.0", "simplebar": "^5.3.5" } -} \ No newline at end of file +} diff --git a/Props/webpack.common.js b/Props/webpack.common.js index 2b85be0..ad55360 100644 --- a/Props/webpack.common.js +++ b/Props/webpack.common.js @@ -9,22 +9,15 @@ let config = { obj[name] = elem; return obj; }, { - site: [path.resolve("./assets/js/main.js"), path.resolve("./assets/scss/main.scss")], + site: [path.resolve("./assets/js/site-wide.js"), path.resolve("./assets/styles/site-wide.scss"), path.resolve("./assets/styles/dependencies.css")], }), output: { filename: "[name].js", path: path.resolve("./wwwroot/js"), + clean: true, }, module: { rules: [ - { - test: /\.s[ac]ss$/i, - use: [ - "style-loader", - "css-loader", - "sass-loader", - ], - }, { test: /\.m?js$/, exclude: /(node_modules|bower_components)/, @@ -36,10 +29,26 @@ let config = { } } }, + { + test: /\.s[ac]ss$/i, + use: [ + "style-loader", + "css-loader", + "sass-loader", + ], + }, + { + test: /\.css$/i, + use: ["style-loader", "css-loader"], + }, { test: /\.(png|svg|jpg|jpeg|gif)$/i, type: "asset/resource", - } + }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/i, + type: "asset/resource", + }, ] }, resolve: { diff --git a/Props/webpack.dev.js b/Props/webpack.dev.js index abf38c3..3b76f5d 100644 --- a/Props/webpack.dev.js +++ b/Props/webpack.dev.js @@ -3,7 +3,18 @@ const common = require("./webpack.common"); let config = { mode: "development", - devtool: "eval-source-map", + devtool: "eval-cheap-module-source-map", + output: { + pathinfo: false, + }, + optimization: { + removeAvailableModules: false, + removeEmptyChunks: false, + mergeDuplicateChunks: false, + providedExports: false, + splitChunks: false, + innerGraph: false, + } }; module.exports = merge(common, config); diff --git a/Props/webpack.prod.js b/Props/webpack.prod.js index f0ac5fc..a1c2c71 100644 --- a/Props/webpack.prod.js +++ b/Props/webpack.prod.js @@ -4,6 +4,11 @@ const common = require("./webpack.common"); let config = { mode: "production", devtool: "nosources-source-map", + optimization: { + mangleExports: "size", + moduleIds: "size", + chunkIds: "size", + } }; module.exports = merge(common, config);