marko-js / webpack

A loader for marko files and a plugin for universal bundling
MIT License
13 stars 4 forks source link

Assets tag #44

Closed mlrawlings closed 3 years ago

mlrawlings commented 3 years ago

Description

The <webpack-assets> tag can be used along with the plugin in a multi-compiler setup. This tag allows you to inject <script>/<style> tags into a server-rendered template for the assets of an entry in the client compiler.

Example Usage

<webpack-assets entry="tracking"/>

Example Config

// ...
export default [
  {
    entry: "./server.js",
    plugins: [markoPlugin.server]
    // ...
  },
  {
    // ...
    entry: {
      tracking: "./tracking.js"
    },
    plugins: [markoPlugin.browser]
  }
];

Motivation and Context

Checklist: