mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-11 18:14:27 +00:00
generate rollup and webpack templates from a single unified branch
This commit is contained in:
13
_template/build-pkg.js
Normal file
13
_template/build-pkg.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const type = process.argv[2];
|
||||
|
||||
const pkg = require('../package_template.json');
|
||||
for (const key in pkg['merge-configs'][type]) {
|
||||
Object.assign(pkg[key], pkg['merge-configs'][type][key]);
|
||||
}
|
||||
delete pkg['merge-configs'];
|
||||
fs.writeFileSync(
|
||||
__dirname + '/../package.json',
|
||||
JSON.stringify(pkg, null, ' ') + '\n'
|
||||
);
|
||||
33
_template/build.sh
Executable file
33
_template/build.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
cd "$(dirname $0)"/..
|
||||
|
||||
# write out SSH key
|
||||
[ "$SSH_KEY" ] || exit 1
|
||||
echo "$SSH_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
|
||||
# make sure we're on master, and delete the rollup and webpack branches
|
||||
git symbolic-ref HEAD refs/heads/master
|
||||
git reset --hard
|
||||
git branch -D rollup webpack
|
||||
|
||||
# create the rollup branch off the current master
|
||||
git checkout -b rollup
|
||||
node _template/build-pkg.js rollup
|
||||
git rm -r --cached .travis.yml _template package_template.json webpack.config.js
|
||||
git add package.json
|
||||
git commit -m 'Sapper template for Rollup'
|
||||
git symbolic-ref HEAD refs/heads/master
|
||||
git reset --hard
|
||||
|
||||
# create the webpack branch off the current master
|
||||
git checkout -b webpack
|
||||
node _template/build-pkg.js webpack
|
||||
git rm -r --cached .travis.yml _template package_template.json rollup.config.js
|
||||
git add package.json
|
||||
git commit -m 'Sapper template for webpack'
|
||||
git symbolic-ref HEAD refs/heads/master
|
||||
git reset --hard
|
||||
|
||||
# force push rollup and webpack branches
|
||||
git push git@github.com:sveltejs/sapper-template.git rollup webpack -f
|
||||
Reference in New Issue
Block a user