-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transpiled 'interaction.js' to 'interaction.min.js' to significantly improve the web app's compatibility with older browsers. I chose to use Gulp to automate this process. Terser was also used to minify and mangle the transpiled output from Babel.
- Loading branch information
1 parent
3b15c1a
commit 9d3fa18
Showing
6 changed files
with
71 additions
and
32 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 |
---|---|---|
|
@@ -21,4 +21,8 @@ crossword_puzzle.egg-info | |
dist | ||
|
||
# dev tools | ||
.ruff_cache | ||
.ruff_cache | ||
|
||
# npm | ||
node_modules | ||
yarn.lock |
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,22 @@ | ||
/* To begin transpiling the javascript: | ||
1. npm install --global yarn | ||
2. yarn install | ||
3. gulp | ||
*/ | ||
|
||
const gulp = require("gulp"); | ||
const babel = require("gulp-babel"); | ||
const terser = require("gulp-terser"); | ||
const rename = require("gulp-rename") | ||
|
||
const presets = ["@babel/preset-env"]; | ||
|
||
gulp.task("main", () => { | ||
return gulp.src("./crossword_puzzle/cword_webapp/static/interaction.js") | ||
.pipe(babel({ presets })) // preset-env for ES5 | ||
.pipe(terser()) // minify | ||
.pipe(rename("interaction.min.js")) | ||
.pipe(gulp.dest("./crossword_puzzle/cword_webapp/static/")); | ||
}); | ||
|
||
gulp.task("default", gulp.series("main")); |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,12 @@ | ||
{ | ||
"devDependencies": { | ||
"@babel/cli": "^7.24.5", | ||
"@babel/core": "^7.24.5", | ||
"@babel/preset-env": "^7.24.5", | ||
"gulp": "^5.0.0", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-terser": "^2.1.0", | ||
"terser": "^5.31.0" | ||
} | ||
} |