Switched expose-loader with ProvidePlugin

This commit is contained in:
squidfunk 2020-07-27 09:57:24 +02:00
parent ceadfbf8cf
commit cb974e5bd4
9 changed files with 75 additions and 68 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,8 @@
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.1688372e.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.877163d5.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.877163d5.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.a68abb33.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.a68abb33.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.1b3b2620.min.js",
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.1b3b2620.min.js.map",
"assets/stylesheets/main.css": "assets/stylesheets/main.5be48db2.min.css",
"assets/stylesheets/main.css.map": "assets/stylesheets/main.5be48db2.min.css.map",
"assets/stylesheets/overrides.css": "assets/stylesheets/overrides.5036298b.min.css",

View File

@ -207,7 +207,7 @@
base: "{{ base_url }}",
features: {{ config.theme.features | tojson }},
search: Object.assign({
worker: "{{ 'assets/javascripts/worker/search.a68abb33.min.js' | url }}"
worker: "{{ 'assets/javascripts/worker/search.1b3b2620.min.js' | url }}"
}, typeof search !== "undefined" && search)
})
</script>

View File

@ -59,7 +59,6 @@
"copy-webpack-plugin": "^6.0.3",
"css-loader": "^4.0.0",
"event-hooks-webpack-plugin": "^2.1.7",
"expose-loader": "^0.7.5",
"github-types": "^1.0.0",
"gitlab": "^14.2.2",
"html-minifier": "^4.0.0",

View File

@ -20,8 +20,6 @@
* IN THE SOFTWARE.
*/
import "expose-loader?lunr!lunr"
import { Search, SearchIndexConfig } from "../../_"
import { SearchMessage, SearchMessageType } from "../message"

View File

@ -31,7 +31,7 @@ import * as path from "path"
import { toPairs } from "ramda"
import { minify as minjs } from "terser"
import { TsconfigPathsPlugin } from "tsconfig-paths-webpack-plugin"
import { Configuration } from "webpack"
import { Configuration, ProvidePlugin } from "webpack"
import * as AssetsManifestPlugin from "webpack-assets-manifest"
/* ----------------------------------------------------------------------------
@ -370,7 +370,17 @@ export default (_env: never, args: Configuration): Configuration[] => {
filename: `[name]${hash}.js`,
hashDigestLength: 8,
libraryTarget: "var"
}
},
/* Plugins */
plugins: [
...base.plugins,
/* Search implementation */
new ProvidePlugin({
lunr: "lunr"
})
]
}
]
}