-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compiler): introduce compile/transform/bundle diagnostics (#256)
- Loading branch information
Showing
118 changed files
with
1,830 additions
and
2,325 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const path = require("path"); | ||
const replace = require("rollup-plugin-replace"); | ||
const { rollup } = require("rollup"); | ||
const { version } = require("../package.json"); | ||
|
||
async function updateVersion(version) { | ||
const sourcePath = path.resolve("dist/commonjs/index.js"); | ||
|
||
const result = await rollup({ | ||
input: sourcePath, | ||
plugins: [ | ||
replace({ | ||
__VERSION__: version | ||
}) | ||
] | ||
}); | ||
|
||
await result.write({ | ||
file: sourcePath, | ||
format: "cjs", | ||
sourcemap: false, // keep typescript generated map to stay consistent with the rest of the files. | ||
}); | ||
|
||
console.log("Compiler version: ", version); | ||
} | ||
|
||
if (!version || typeof version !== "string") { | ||
throw new Error( | ||
"Failed to update compiler version. Expected version value as a string, received: " + | ||
version | ||
); | ||
} | ||
|
||
updateVersion(version); |
Oops, something went wrong.