- main entry point is
bundle.js
An npm project for demonstrating Azure Immersive Reader using TailwindCSS. Using:
node-sasswhich compiles.scssfiles in CSSautoprefixer&postcss-clito add vendor prefixes to compiled CSSstylelintto check for errors in CSSonchangeto rebuild CSS whenever a change occurs in an.scssfilebrowser-syncto run a local web serverbpm-run-allto run multiple npm-scripts in parallel or sequential mainly for Windows systemswebpack&babelto use modern JS syntax and transpile into browser compatible JSeslintto keep the code more consistent and to avoid bugsposthtml&posthtml-modulesto use HTML partials i.e.<module href="/components/head.html"></module>postcssimports the tailwindcss CSS and outputs to a combinedtailwind.cssfile in the/distdirectoryhtmlnanoto compress outputted HTML
- Always import Javascript modules into
main.jsto keep things tidy
- Always import scss modules into
index.scssto keep things tidy
- tailwind imports are in
/src/tailwind.css
npm run buildruns allbuild:*scripts in parallelnpm run watchruns allwatch:*scripts and starts the local web server in parallelnpm run serveruns a web server using files in the/distdirectory
- run
npm ito install all dependecies - run
npm run buildto build to the output/distdirectory
- Turned off
no-unused-vars,no-undefin.eslintrcto overcome trivial build errors with JQuery - JQuery file is now ignored as part of the build process by residing in its own directory
CopyWebpackPluginis used to pass the JQuery file through to/distwithout 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