rollup-theme-extensions

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

A Rollup config generator for building Shopify Theme App Extensions with TypeScript and CSS support. Version 1.1.1 is the latest stable release. It handles TypeScript compilation and minification, CSS minification, and Rollup bundling with custom source/output folders. Differentiator: purpose-built for Shopify theme app extension folder structure, with opinionated defaults for that ecosystem. Currently no significant release cadence.

error Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'rollup-theme-extensions'
cause Package not installed or missing from node_modules.
fix
Run 'npm install --save-dev rollup-theme-extensions rollup' in your project.
error The requested module 'rollup-theme-extensions' does not provide an export named 'default'
cause Using default import when only named export 'createRollupConfig' exists.
fix
Use 'import { createRollupConfig } from 'rollup-theme-extensions'' instead of default import.
error Error: No extensions found in source directory: ...
cause Source directory does not contain subfolders starting with 'theme-'.
fix
Create subfolders with 'theme-' prefix inside the source directory, each containing an 'assets' folder.
gotcha Source maps are currently disabled because Shopify does not allow sourcemap file extensions inside the /assets folder.
fix No fix; sourcemaps are intentionally turned off. Do not attempt to enable via plugin options.
gotcha The source folder must contain subfolders with 'theme-' prefix; any other folder will be ignored.
fix Ensure your extension directories are named starting with 'theme-' (e.g., 'theme-my-extension').
gotcha Output is always placed inside an 'assets' folder within the extension directory; this cannot be customized.
fix Do not specify output paths; they are fixed to <extensionsDir>/<extension-name>/assets/.
deprecated No deprecated features known in current version.
npm install rollup-theme-extensions
yarn add rollup-theme-extensions
pnpm add rollup-theme-extensions

Basic Rollup config for Shopify theme app extensions using TypeScript and CSS minification.

// @ts-check
import { createRollupConfig } from 'rollup-theme-extensions';

const extensionsSourceDir = 'extensions.src';
const extensionsDir = 'extensions';

export default createRollupConfig({
  extensionsSourceDir,
  extensionsDir,
  minifyCss: true,
  minifyJs: true,
});