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.
Common errors
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.
Warnings
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.
Install
npm install rollup-theme-extensions yarn add rollup-theme-extensions pnpm add rollup-theme-extensions Imports
- createRollupConfig wrong
const createRollupConfig = require('rollup-theme-extensions')correctimport { createRollupConfig } from 'rollup-theme-extensions' - default wrong
import { default } from 'rollup-theme-extensions'correctimport createRollupConfig from 'rollup-theme-extensions' - RollupThemeExtensionsOptions
import type { RollupThemeExtensionsOptions } from 'rollup-theme-extensions'
Quickstart
// @ts-check
import { createRollupConfig } from 'rollup-theme-extensions';
const extensionsSourceDir = 'extensions.src';
const extensionsDir = 'extensions';
export default createRollupConfig({
extensionsSourceDir,
extensionsDir,
minifyCss: true,
minifyJs: true,
});