rollup-plugin-lux

raw JSON →
3.0.0 verified Mon Apr 27 auth: no javascript

A Rollup plugin that ensures constructor.name remains correct after bundling Lux applications. Version 3.0.0 is the current stable release. It appends an Object.defineProperty call below each constructor that extends a Lux base class to preserve the class name, which would otherwise be lost due to Rollup's module bundling. This plugin is intended for internal use by the Lux framework and is not required for typical Lux users.

error Error: Cannot find module 'rollup-plugin-lux'
cause Package not installed or not in node_modules.
fix
Run npm install rollup-plugin-lux --save-dev
error TypeError: luxPlugin is not a function
cause Incorrect import style: using require() instead of default import.
fix
Use import luxPlugin from 'rollup-plugin-lux'
gotcha Only works with classes that extend Lux base classes (e.g., Model, Controller). Custom classes without Lux superclass are unaffected.
fix Ensure classes that need name preservation extend from a Lux class.
npm install rollup-plugin-lux
yarn add rollup-plugin-lux
pnpm add rollup-plugin-lux

Example Rollup configuration using the Lux plugin to preserve class names in bundled output.

// rollup.config.js
import luxPlugin from 'rollup-plugin-lux';

export default {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.js',
    format: 'cjs'
  },
  plugins: [
    luxPlugin()
  ]
};