- main entry point is
bundle.js
An npm project for demonstrating Azure Immersive Reader using TailwindCSS. Using:
node-sass
which compiles.scss
files in CSSautoprefixer
&postcss-cli
to add vendor prefixes to compiled CSSstylelint
to check for errors in CSSonchange
to rebuild CSS whenever a change occurs in an.scss
filebrowser-sync
to run a local web serverbpm-run-all
to run multiple npm-scripts in parallel or sequential mainly for Windows systemswebpack
&babel
to use modern JS syntax and transpile into browser compatible JSeslint
to keep the code more consistent and to avoid bugsposthtml
&posthtml-modules
to use HTML partials i.e.<module href="/components/head.html"></module>
postcss
imports the tailwindcss CSS and outputs to a combinedtailwind.css
file in the/dist
directoryhtmlnano
to compress outputted HTML
- Always import Javascript modules into
main.js
to keep things tidy
- Always import scss modules into
index.scss
to keep things tidy
- tailwind imports are in
/src/tailwind.css
npm run build
runs allbuild:*
scripts in parallelnpm run watch
runs allwatch:*
scripts and starts the local web server in parallelnpm run serve
runs a web server using files in the/dist
directory
- run
npm i
to install all dependecies - run
npm run build
to build to the output/dist
directory
- Turned off
no-unused-vars
,no-undef
in.eslintrc
to overcome trivial build errors with JQuery - JQuery file is now ignored as part of the build process by residing in its own directory
CopyWebpackPlugin
is used to pass the JQuery file through to/dist
without transformation taking place- bundles two types of Javascript, JQuery is unchanged and passed through whilst regular Javascript is transformed and combined through webpack
- Replace JQuery support