Skip to content

Commit 8cf0289

Browse files
committed
[bugfix] exports of entry js are lost with auto inject
1 parent 8182b54 commit 8cf0289

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## V2.2.13
2+
- **[v2]** [bugfix] exports of entry js are lost with auto inject
13
## V2.2.12
24
- **[v2]** only use cache in watch mode
35
- **[v2]** refine inject logic

lib/plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ const onEnd = async (build, options, result) => {
316316

317317
const buildJs = async (entryName, entryPath, jsCode) => {
318318
const r = (p) => path.relative(absOutdir, p).split(path.sep).join(path.posix.sep);
319-
const imports = `import "./${r(entryPath)}";`;
319+
const imports = `import "./${r(entryPath)}";\nexport * from "./${r(entryPath)}";`;
320320
if (sourcemap === 'external') {
321321
await appendFile(entryPath, `\n//# sourceMappingURL=${r(entryPath)}.map`, { encoding: 'utf8' });
322322
} else if (publicPath && sourcemap) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-css-modules-plugin",
3-
"version": "2.2.12",
3+
"version": "2.2.13",
44
"description": "A esbuild plugin to bundle css modules into js(x)/ts(x).",
55
"main": "index.js",
66
"keywords": [

0 commit comments

Comments
 (0)