vaderjs 2.2.2 → 2.2.3
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/bundler/index.js +16 -13
- package/package.json +1 -1
package/bundler/index.js
CHANGED
|
@@ -97,9 +97,9 @@ const handleReplacements = (code) => {
|
|
|
97
97
|
}
|
|
98
98
|
if (hasImport && line.includes('react')) {
|
|
99
99
|
line = line.replace('react', '/src/vader/index.js')
|
|
100
|
-
}
|
|
100
|
+
}
|
|
101
101
|
if(hasImport && line.includes('public') && line.includes('.png') ||
|
|
102
|
-
|
|
102
|
+
line.includes('.jpg') || line.includes('.jpeg') || line.includes('.gif') || line.includes('.svg')) {
|
|
103
103
|
let url = line.split('"')[1]
|
|
104
104
|
// replace ../../
|
|
105
105
|
var b4 = url
|
|
@@ -182,17 +182,21 @@ hasImport && line.includes('.jpg') || hasImport && line.includes('.jpeg')
|
|
|
182
182
|
return c
|
|
183
183
|
}
|
|
184
184
|
builtCode = handleReplacements(builtCode)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
|
|
186
|
+
builtCode += `
|
|
187
|
+
var process = {
|
|
188
|
+
env: {
|
|
189
|
+
${Object.keys(process.env)
|
|
190
|
+
.filter((key) =>
|
|
191
|
+
!['bindes', 'ENTRYPOINT', 'ROOT', 'OUT', 'file', 'DEV',
|
|
192
|
+
'size', 'filePath', 'isAppFile', 'isJsx', 'INPUT'].includes(key)
|
|
193
|
+
)
|
|
194
|
+
.map((key) => `${key}: "${process.env[key]}"`)
|
|
195
|
+
.join(',\n')}
|
|
193
196
|
}
|
|
194
|
-
}
|
|
195
|
-
|
|
197
|
+
}
|
|
198
|
+
`;
|
|
199
|
+
fs.writeFileSync(path.join(process.cwd(), 'dist', process.env.filePath), builtCode)
|
|
196
200
|
let isClass = function (element) {
|
|
197
201
|
return element && element.toString().startsWith("class");
|
|
198
202
|
};
|
|
@@ -264,7 +268,6 @@ const generatePage = async (
|
|
|
264
268
|
import {render, e} from '/src/vader/index.js'
|
|
265
269
|
window.e = e
|
|
266
270
|
render(c, document.body)
|
|
267
|
-
console.log(e)
|
|
268
271
|
</script>
|
|
269
272
|
|
|
270
273
|
${process.env.bindes}
|