Giter Club home page Giter Club logo

code-library's Introduction

Odopod Code Library (Odo) Build Status

A collection of vanilla JavaScript components used in Odopod projects.

Want to contribute to Odo?

Take a look at CONTRIBUTING.md.

Packages

The Odo repo is managed as a monorepo; it's composed of many npm packages.

Package Version
@odopod/odo-affix npm
@odopod/odo-background-video npm
@odopod/odo-base-component npm
@odopod/odo-carousel npm
@odopod/odo-device npm
@odopod/odo-dialog npm
@odopod/odo-draggable npm
@odopod/odo-dropdown npm
@odopod/odo-dual-viewer npm
@odopod/odo-helpers npm
@odopod/odo-hotspots npm
@odopod/odo-module npm
@odopod/odo-object-fit npm
@odopod/odo-on-swipe npm
@odopod/odo-pointer npm
@odopod/odo-responsive-attributes npm
@odopod/odo-responsive-classes npm
@odopod/odo-responsive-images npm
@odopod/odo-reveal npm
@odopod/odo-sassplate npm
@odopod/odo-scroll-animation npm
@odopod/odo-scroll-feedback npm
@odopod/odo-share npm
@odopod/odo-sticky-headers npm
@odopod/odo-tabs npm
@odopod/odo-tap npm
@odopod/odo-video npm
@odopod/odo-viewport npm
@odopod/odo-window-events npm

Tips for advanced webpack configuration

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:

  • No dependencies for odo are bundled with their dist files. For example, the debounce package is bundled in a couple odo components.
  • Use the same babel preset for your app's code and odo components. Maybe you're using babel-preset-env so that you can compile less.
  • Less boilerplate code. Each odo component comes with webpack's UMD wrapper so that it can work in multiple environments.

Use the alias object to map requests for odo components to their source files instead of dist files. This configuration is intended for webpack v2.

// 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/index.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',
    },
  }
]

code-library's People

Contributors

vestride avatar johnny5k avatar

Watchers

James Cloos avatar Simone Mazzoni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.