@pure-ds/storybook 0.3.15 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,14 +167,16 @@ const config = {
167
167
 
168
168
  if (isConsumerProject && fs.existsSync(userPublicPath)) {
169
169
  config.plugins = config.plugins || [];
170
- config.plugins.push({
170
+ // Insert at the beginning to run before other plugins
171
+ config.plugins.unshift({
171
172
  name: 'pds-public-esm-loader',
172
- resolveId(id) {
173
+ enforce: 'pre', // Run before Vite's built-in plugins
174
+ resolveId(id, importer) {
173
175
  // Handle absolute paths starting with /assets/ or other paths in public
174
176
  if (id.startsWith('/') && !id.startsWith('/@') && !id.startsWith('/node_modules')) {
175
177
  const filePath = resolve(userPublicPath, id.slice(1)); // Remove leading /
176
178
  if (fs.existsSync(filePath) && (filePath.endsWith('.js') || filePath.endsWith('.mjs'))) {
177
- // Return a virtual module ID
179
+ // Return a virtual module ID to bypass Vite's public folder check
178
180
  return `\0virtual:public-esm:${id}`;
179
181
  }
180
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pure-ds/storybook",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Storybook showcase for Pure Design System with live configuration",
5
5
  "type": "module",
6
6
  "private": false,