Skip to content

Commit

Permalink
Create CookieMonsterDev
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord committed May 2, 2021
1 parent 32b7bfc commit 21b8a16
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 8 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,21 @@ jobs:
run: npx eslint src
- name: Run Mocha tests
run: npx mocha
- name: Check if CookieMonster.js is built correctly
- name: Check if CookieMonsterDev.js is built correctly
run: |
npx webpack -o ./tmp --env production
if cmp <(head -n 2 dist/CookieMonster.js) <(head -n 2 tmp/CookieMonster.js); then
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 tmp/CookieMonsterDev.js); then
echo '### SUCCESS: CookieMonsterDev is correctly built! ###'
else
echo '### WARNING: CookieMonsterDev.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
exit 1
fi
- name: Check if CookieMonster.js is built correctly
if: github.ref == 'refs/heads/master'
run: |
if cmp <(head -n 2 dist/CookieMonsterDev.js) <(head -n 2 dist/CookieMonster.js); then
echo '### SUCCESS: CookieMonster is correctly built! ###'
else
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to run "npm run build" after saving all your changes! ###'
echo '### WARNING: CookieMonster.js does not seem to be correct. Make sure to copy CookieMonsterDev.js into CookieMonster.js before merging to master! ###'
exit 1
fi
4 changes: 3 additions & 1 deletion dist/CookieMonster.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CookieMonster.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/CookieMonsterDev.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dist/CookieMonsterDev.js.LICENSE copy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* jscolor - JavaScript Color Picker
*
* @link http://jscolor.com
* @license For open source use: GPLv3
* For commercial use: JSColor Commercial License
* @author Jan Odvarko - East Desire
*
* See usage examples at http://jscolor.com/examples/
*/
1 change: 1 addition & 0 deletions dist/CookieMonsterDev.js.map

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
],
"scripts": {
"eslint-src": "eslint src test",
"build": "run-s eslint-src pack-prod remove-comment test",
"build": "run-s eslint-src pack-prod test",
"build-test": "run-s pack-dev",
"pack-prod": "webpack --env production",
"pack-dev": "webpack",
"remove-comment": "sed -i '' -e '/\\/\\/# sourceMappingURL.*/d' dist/CookieMonster.js",
"test": "mocha"
},
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');

module.exports = function (env) {
return {
Expand All @@ -21,8 +22,15 @@ module.exports = function (env) {
],
},
output: {
filename: 'CookieMonster.js',
filename: 'CookieMonsterDev.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: 'CookieMonsterDev.js.map',
publicPath: 'https://cookiemonsterteam.github.io/CookieMonster/dist/',
fileContext: 'public',
}),
],
};
};

0 comments on commit 21b8a16

Please sign in to comment.