Skip to content

Commit

Permalink
Rollup with resolve (#316)
Browse files Browse the repository at this point in the history
* update rollup and add @rollup/plugin-node-resolve

* move manifest.json for test to test/extension/

* refactor test emulator dirs
  • Loading branch information
tilfin authored Oct 25, 2023
1 parent ebd018b commit 9d29a0f
Show file tree
Hide file tree
Showing 12 changed files with 608 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
coverage
dist
node_modules
test/extension/*
!test/extension/background.js
!test/extension/manifest.json
8 changes: 4 additions & 4 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ popup=dist/chrome/js/popup.js
background=dist/chrome/js/background.js
supporters=dist/chrome/js/supporters.js

rollup src/js/options.js --file $options
rollup src/js/popup.js --file $popup
rollup src/js/background.js --file $background
rollup src/js/supporters.js --file $supporters
rollup -c ./rollup.config.js src/js/options.js --file $options
rollup -c ./rollup.config.js src/js/popup.js --file $popup
rollup -c ./rollup.config.js src/js/background.js --file $background
rollup -c ./rollup.config.js src/js/supporters.js --file $supporters

\cp -f $options dist/firefox/js/options.js
\cp -f $popup dist/firefox/js/popup.js
Expand Down
21 changes: 21 additions & 0 deletions bin/build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#--
# build_test.sh
#--
destdir=test/extension

cp src/*.html $destdir/

mkdir -p $destdir/js
for file in src/js/*; do
if [ -f "$file" ]; then
fname="${file##*/}"
rollup -c ./rollup.config.js src/js/$fname --file $destdir/js/$fname
fi
done

mkdir -p $destdir/tests
for file in src/tests/*; do
fname="${file##*/}"
rollup -c ./rollup.config.js src/tests/$fname --file $destdir/tests/$fname
done
Loading

0 comments on commit 9d29a0f

Please sign in to comment.