A collection of vanilla JavaScript components used in Odopod projects.
Take a look at CONTRIBUTING.md.
The Odo repo is managed as a monorepo; it's composed of many npm packages.
If you use webpack (or another bundler) for your project and are already using a compiler for your JavaScript (like babel), you have the option of using odo component source files and compiling them with your project.
This has a couple benefits:
debounce
package is bundled in a couple odo components.babel-preset-env
so that you can compile less.Use the alias
object to map requests for odo components to their source files instead of dist files. This configuration is intended for webpack 2, 3, or 4.
// Webpack config
{
resolve: {
alias: {
'@odopod/odo-carousel$': '@odopod/odo-carousel/src/carousel.js',
'@odopod/odo-device$': '@odopod/odo-device/src/device.js',
'@odopod/odo-draggable$': '@odopod/odo-draggable/src/draggable.js',
'@odopod/odo-helpers$': '@odopod/odo-helpers/src/helpers.js',
'@odopod/odo-pointer$': '@odopod/odo-pointer/src/pointer.js',
},
},
}
Don't exclude
odo components from being compiled with babel.
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules\/(?!@odopod\/odo-)/,
loader: 'babel-loader',
},
}
]
Version | Tag | Published |
---|---|---|
1.1.2 | latest | 4yrs ago |