earthsdk3-assets 3.0.18 → 3.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/plugins/rspack.cjs
CHANGED
|
@@ -72,12 +72,13 @@ class EarthsdkAssetsRspackPlugin {
|
|
|
72
72
|
|
|
73
73
|
compiler.hooks.afterEnvironment.tap('EarthsdkAssetsRspackPlugin', () => {
|
|
74
74
|
const devServer = compiler.options.devServer;
|
|
75
|
+
const outputPath = compiler.options.output.path || 'dist';
|
|
75
76
|
if (devServer) {
|
|
76
77
|
const originalSetup = devServer.setupMiddlewares;
|
|
77
78
|
devServer.setupMiddlewares = (middlewares, devServer) => {
|
|
78
79
|
devServer.app.use('/js', (req, res, next) => {
|
|
79
80
|
try {
|
|
80
|
-
const filePath = path.resolve(
|
|
81
|
+
const filePath = path.resolve(outputPath, '.' + decodeURIComponent(req.url));
|
|
81
82
|
if (!fs.existsSync(filePath)) {
|
|
82
83
|
next();
|
|
83
84
|
return;
|
package/src/plugins/webpack.cjs
CHANGED
|
@@ -62,12 +62,13 @@ class EarthsdkAssetsWebpackPlugin {
|
|
|
62
62
|
|
|
63
63
|
compiler.hooks.afterEnvironment.tap('EarthsdkAssetsWebpackPlugin', () => {
|
|
64
64
|
const devServer = compiler.options.devServer;
|
|
65
|
+
const outputPath = compiler.options.output.path || 'dist';
|
|
65
66
|
if (devServer) {
|
|
66
67
|
const originalSetup = devServer.setupMiddlewares;
|
|
67
68
|
devServer.setupMiddlewares = (middlewares, devServer) => {
|
|
68
69
|
devServer.app.use('/js', (req, res, next) => {
|
|
69
70
|
try {
|
|
70
|
-
const filePath = path.resolve(
|
|
71
|
+
const filePath = path.resolve(outputPath, '.' + decodeURIComponent(req.url));
|
|
71
72
|
if (!fs.existsSync(filePath)) {
|
|
72
73
|
next();
|
|
73
74
|
return;
|