Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[library] Add lib entrypoint and output #276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node server.js",
"watch:dev": "npx rollup --config rollup.config.js -w & nodemon -d 3 ./server.js localhost 8000",
"build:dev": "npx rollup --config rollup.config.js",
"minify:js": "javascript-obfuscator public/creep.js -o docs/creep.js --identifier-names-generator \"mangled-shuffled\"",
"minify:js": "javascript-obfuscator public/creep.js -o docs/creep.js --identifier-names-generator \"mangled-shuffled\" && javascript-obfuscator public/lib.js -o docs/lib.js --identifier-names-generator \"mangled-shuffled\"",
"autoprefixer": "postcss public/style.css -u autoprefixer -o public/style.prefix.css",
"minify:css": "cleancss -o docs/style.min.css public/style.prefix.css",
"build:css": "yarn autoprefixer && yarn minify:css",
Expand Down
33 changes: 23 additions & 10 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import typescript from '@rollup/plugin-typescript';

export default {
input: 'src/creep.ts',
output: {
dir: 'public',
format: 'iife',
sourcemap: true,
export default [
{
input: 'src/creep.ts',
output: {
dir: 'public',
format: 'iife',
sourcemap: true,
},
plugins: [
typescript({ tsconfig: './tsconfig.json' }),
],
},
plugins: [
typescript({ tsconfig: './tsconfig.json' }),
],
};
{
input: 'src/lib.ts',
output: {
dir: 'public',
format: 'iife',
sourcemap: false,
},
plugins: [
typescript({ tsconfig: './tsconfig.json' }),
],
},
]
Loading