Skip to content

Use with webpack

Example Project

Install the loader for Webpack:

npm install --save-dev @macaron-elements/loader-webpack

Configure webpack.config.js:

module.exports = {
  // ...
  module: {
    // ...
    rules: [
      {
        test: /\.macaron/,
        use: ["@macaron-elements/loader-webpack"],
      },
    ],
  },
};

Use in JS:

import "./components.macaron";
const element = document.createElement("my-component");