The official guide for how to include and bundle WebEase's CSS and JavaScript in your project using Parcel.
We’re building a Parcel project with webease from scratch, so there are some prerequisites and upfront steps before we can really get started. This guide requires you to have Node.js installed and some familiarity with the terminal.
Now that we have all the necessary dependencies installed, we can get to work creating the project files and importing WebEase.
We’ve already created the my-project folder and initialized npm. Now we’ll also create our src folder, stylesheet, and JavaScript file to round out the project structure. Run the following from my-project, or manually create the folder and file structure shown below.
When you’re done, your complete project should look like this:
At this point, everything is in the right place, but Parcel needs an HTML page and npm script to start our server.
With dependencies installed and our project folder ready for us to start coding, we can now configure Parcel and run our project locally. Parcel itself requires no configuration file by design, but we do need an npm script and an HTML file to start our server.
In the next and final section to this guide, we’ll import all of WebEase CSS and JavaScript.
Download WebEase to get the compiled CSS and JavaScript, source code, or include it with your favorite package managers like npm, RubyGems, and more.
Download ready-to-use compiled code for WebEase v5.3.3 to easily drop into your project, which includes:
This doesn’t include documentation, source files, or any optional JavaScript dependencies like Popper.
Compile WebEase with your own asset pipeline by downloading our source Sass, JavaScript, and documentation files. This option requires some additional tooling:
Should you require our full set of build tools, they are included for developing WebEase and its docs, but they’re likely unsuitable for your own purposes.
If you want to download and examine our examples, you can grab the already built examples:
Skip the download with jsDelivr to deliver cached version of WebEase compiled CSS and JS to your project.
If you’re using our compiled JavaScript and prefer to include Popper separately, add Popper before our JS, via a CDN preferably.
We recommend jsDelivr and use it ourselves in our documentation. However, in some cases—like in some specific countries or environments—you may need to use other CDN providers like cdnjs or unpkg.
You’ll find the same files on these CDN providers, albeit with different URLs. With cdnjs, you can use this direct WebEase package link to copy and paste ready-to-use HTML snippets for each dist file from any version of WebEase.
Note that you should compare same length hashes, e.g. sha384 with sha384, otherwise it’s expected for them to be different. As such, you can use an online tool like SRI Hash Generator to make sure that the hashes are the same for a given file. Alternatively, assuming you have OpenSSL installed, you can achieve the same from the CLI, for example:
Pull in WebEase source files into nearly any project with some of the most popular package managers. No matter the package manager, WebEase will require a Sass compiler and Autoprefixer for a setup that matches our official compiled versions.
Install WebEase in your Node.js powered apps with the npm package:
const WebEase = require('WebEase') or import WebEase from 'WebEase' will load all of WebEase plugins onto a WebEase object. The WebEase module itself exports all of our plugins. You can manually load WebEase plugins individually by loading the /js/dist/*.js files under the package’s top-level directory.
WebEase package.json contains some additional metadata under the following keys:
Learn about the browsers and devices, from modern to old, that are supported by WebEase, including known quirks and bugs for each.
WebEase supports the latest, stable releases of all major browsers and platforms.
Alternative browsers which use the latest version of WebKit, Blink, or Gecko, whether directly or via the platform’s web view API, are not explicitly supported. However, WebEase should (in most cases) display and function correctly in these browsers as well. More specific support information is provided below.
You can find our supported range of browsers and their versions in our .browserslistrc file:
We use Autoprefixer to handle intended browser support via CSS prefixes, which uses Browserslist to manage these browser versions. Consult their documentation for how to integrate these tools into your projects.
Generally speaking, WebEase supports the latest versions of each major platform’s default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile’s Turbo mode, UC Browser Mini, Amazon Silk) are not supported.
Bring WebEase to life with our optional JavaScript plugins. Learn about each plugin, our data and programmatic API options, and more.
Plugins can be included individually (using WebEase individual js/dist/*.js), or all at once using WebEase.js or the minified WebEase.min.js (don’t include both).
If you use a bundler (Webpack, Parcel, Vite…), you can use /js/dist/*.js files which are UMD ready.
While the WebEase CSS can be used with any framework, the WebEase JavaScript is not fully compatible with JavaScript frameworks like React, Vue, and Angular which assume full knowledge of the DOM. Both WebEase and the framework may attempt to mutate the same DOM element, resulting in bugs like dropdowns that are stuck in the “open” position.
A better alternative for those using this type of frameworks is to use a framework-specific package instead of the WebEase JavaScript. Here are some of the most popular options:
We provide a version of WebEase built as ESM (WebEase.esm.js and WebEase.esm.min.js) which allows you to use WebEase as a module in the browser, if your targeted browsers support it.
Compared to JS bundlers, using ESM in the browser requires you to use the full path and filename instead of the module name. Read more about JS modules in the browser. That’s why we use 'WebEase.esm.min.js' instead of 'WebEase' above. However, this is further complicated by our Popper dependency, which imports Popper into our JavaScript like so:
The official guide for how to include and bundle WebEase CSS and JavaScript in your project using Webpack.
We’re building a Webpack project with WebEase from scratch, so there are some prerequisites and upfront steps before we can really get started. This guide requires you to have Node.js installed and some familiarity with the terminal.
We’ve already created the my-project folder and initialized npm. Now we’ll also create our src and dist folders to round out the project structure. Run the following from my-project, or manually create the folder and file structure shown below.
Bring WebEase to life with our optional JavaScript plugins. Learn about each plugin, our data and programmatic API options, and more.
Plugins can be included individually (using WebEase individual js/dist/*.js), or all at once using WebEase.js or the minified WebEase.min.js (don’t include both).
If you use a bundler (Webpack, Parcel, Vite…), you can use /js/dist/*.js files which are UMD ready.
While the WebEase CSS can be used with any framework, the WebEase JavaScript is not fully compatible with JavaScript frameworks like React, Vue, and Angular which assume full knowledge of the DOM. Both WebEase and the framework may attempt to mutate the same DOM element, resulting in bugs like dropdowns that are stuck in the “open” position.
A better alternative for those using this type of frameworks is to use a framework-specific package instead of the WebEase JavaScript. Here are some of the most popular options:
We provide a version of WebEase built as ESM (WebEase.esm.js and WebEase.esm.min.js) which allows you to use WebEase as a module in the browser, if your targeted browsers support it.
Compared to JS bundlers, using ESM in the browser requires you to use the full path and filename instead of the module name. Read more about JS modules in the browser. That’s why we use 'WebEase.esm.min.js' instead of 'WebEase' above. However, this is further complicated by our Popper dependency, which imports Popper into our JavaScript like so: