parent
0cd4e46055
commit
4aa20fd864
@ -24,11 +24,14 @@ module.exports = (options = {}) => ({
|
|||||||
test: /\.(j|t)s/,
|
test: /\.(j|t)s/,
|
||||||
options: {
|
options: {
|
||||||
multiple: [{
|
multiple: [{
|
||||||
// These will be handled by file-loader. We need the location because
|
// These will be handled by file-loader. Must be a fully formed URI.
|
||||||
// they are parsed as URIs and will throw errors if not fully formed.
|
// The !! prefix causes it to ignore other loaders.
|
||||||
// The !! prefix causes it to ignore other loaders (doesn't work).
|
|
||||||
search: "require\\.toUrl\\(",
|
search: "require\\.toUrl\\(",
|
||||||
replace: "location.protocol + '//' + location.host + location.pathname.replace(/\\/$/,'') + '/' + require('!!file-loader?name=[path][name].[ext]!' + ",
|
replace: `${
|
||||||
|
options.node
|
||||||
|
? "'file://'"
|
||||||
|
: "location.protocol + '//' + location.host + location.pathname.replace(/\\/$/,'')"
|
||||||
|
} + '/' + require('!!file-loader?name=[path][name].[ext]!' + `,
|
||||||
flags: "g",
|
flags: "g",
|
||||||
}, {
|
}, {
|
||||||
search: "require\\.__\\$__nodeRequire",
|
search: "require\\.__\\$__nodeRequire",
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
const merge = require("webpack-merge");
|
const merge = require("webpack-merge");
|
||||||
|
|
||||||
module.exports = (options = {}) => merge(
|
module.exports = (options = {}) => merge(
|
||||||
require("./webpack.general.config")(options), {
|
require("./webpack.general.config")({
|
||||||
|
...options,
|
||||||
|
node: true,
|
||||||
|
}), {
|
||||||
devtool: "none",
|
devtool: "none",
|
||||||
mode: "production",
|
mode: "production",
|
||||||
target: "node",
|
target: "node",
|
||||||
|
Reference in New Issue
Block a user