forked from projectfluent/fluent.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add
npm run build
scripts, using a common Rollup config file
- Loading branch information
Showing
11 changed files
with
53 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
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
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,31 @@ | ||
import { promises } from "fs"; | ||
|
||
// 'fs/promises' is only available from Node.js 14.0.0 | ||
const { readFile } = promises; | ||
|
||
const globalName = { | ||
"@fluent/bundle": "FluentBundle", | ||
"@fluent/dedent": "FluentDedent", | ||
"@fluent/dom": "FluentDOM", | ||
"@fluent/langneg": "FluentLangNeg", | ||
"@fluent/react": "FluentReact", | ||
"@fluent/sequence": "FluentSequence", | ||
"@fluent/syntax": "FluentSyntax", | ||
}; | ||
|
||
module.exports = async function() { | ||
// Current dir is the package's own directory here | ||
const pkgSrc = await readFile("package.json", "utf8"); | ||
const { name, version } = JSON.parse(pkgSrc); | ||
|
||
return { | ||
input: "esm/index.js", | ||
output: { | ||
file: "index.js", | ||
format: "umd", | ||
amd: { id: name }, | ||
name: globalName[name], | ||
banner: `/* ${name}@${version} */`, | ||
}, | ||
}; | ||
}; |