Provide Aggregated ES Module?
semmel opened this issue · comments
While it's easy to "import" dist/Bacon.js
in a web page using an AMD loader or simply via <script>
tag, there is no distribution file for importing as ES module:
import * as Bacon from "../dist/.Bacon.mjs"
requires transpiling and bundling from the original sources - npm install baconjs
is insufficient.
Could such an aggregated ES module file not be generated in scripts/assemble.js
by rollup?
import typescriptPlugin from 'rollup-plugin-typescript2';
const
config = {
input: './src/bacon.ts',
output: {
format: "esm",
file: "./dist/Bacon.mjs" // <-- or whatever name
},
plugins:[
typescriptPlugin({
typescript: require("typescript"),
useTsconfigDeclarationDir: true
})
]
};
export default config;
It would certainly help with "build-step free" development in the browser.
Sure, that would be great! Would you like to submit a related Pull Request :)
… On 10 Oct 2019, at 18:55 , Matthias Seemann ***@***.***> wrote:
While it's easy to "import" dist/Bacon.js in a web page using an AMD loader or simply via <script> tag, there is no distribution file for importing as ES module:
import * as Bacon from "../dist/.Bacon.mjs" requires transpiling and bundling from the original sources - npm install baconjs is insufficient.
Could such a aggregated ES module file to generated in scripts/assemble.js by rollup?
import typescriptPlugin from 'rollup-plugin-typescript2';
const
config = {
input: './src/bacon.ts',
output: {
format: "esm",
file: "./dist/Bacon.mjs" // <-- or whatever name
},
plugins:[
typescriptPlugin({
typescript: require("typescript"),
useTsconfigDeclarationDir: true
})
]
};
export default config;
It would certainly help with "build-step free" development in the browser.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#748?email_source=notifications&email_token=AACHQZFJ4EWWY54ZUAQCUHTQN5GAJA5CNFSM4I7O4V6KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HQ7HM6Q>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACHQZABEJLFGWITU6LZOJLQN5GAJANCNFSM4I7O4V6A>.