-
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.
feat: Add build script for publishing (#41)
- Loading branch information
1 parent
11cac13
commit 72e9bdd
Showing
8 changed files
with
266 additions
and
209 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
/node_modules | ||
public/build | ||
build/* | ||
package-lock.json | ||
|
||
# Tests | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
|
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,49 @@ | ||
import rollupPluginCommonjs from "@rollup/plugin-commonjs"; | ||
import rollupPluginResolve from "@rollup/plugin-node-resolve"; | ||
import rollupPluginReplace from "@rollup/plugin-replace"; | ||
import rollupPluginTerser from "@rollup/plugin-terser"; | ||
import { rollup } from "rollup"; | ||
|
||
const inputOptions = { | ||
input: ["./src/alpaca-map.js"], | ||
plugins: [ | ||
rollupPluginResolve({ | ||
preferBuiltins: true | ||
}), | ||
rollupPluginCommonjs({ | ||
include: /node_modules/ | ||
}), | ||
rollupPluginReplace({ | ||
"process.env.NODE_ENV": JSON.stringify("production"), | ||
preventAssignment: true, | ||
}), | ||
/* | ||
rollupPluginTerser({ | ||
format: { | ||
comments: false | ||
} | ||
}), | ||
*/ | ||
], | ||
}; | ||
|
||
const outputOptionsList = [ | ||
{ | ||
preserveModules: true, | ||
dir: './public/build', | ||
// file: "./public/build/alpaca-map.js", | ||
format: "es", | ||
// sourcemap: true, | ||
interop: 'esModule', | ||
}, | ||
]; | ||
|
||
let bundle = await rollup(inputOptions); | ||
|
||
for (const outputOptions of outputOptionsList) { | ||
await bundle.write(outputOptions); | ||
} | ||
|
||
if (bundle) { | ||
await bundle.close(); | ||
} |
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
Oops, something went wrong.