1.1.2 • Published 1 year ago

@freshcells/next-transpile-vendor-styles v1.1.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

next-transpile-vendor-styles

semantic-release GitHub license badge npm

Adds support for vendor style transpilation for next.js. Based on https://github.com/martpie/next-transpile-modules.

Install

yarn add @freshcells/next-transpile-vendor-styles

Usage

In your nextjs.config.mjs

import { PHASE_PRODUCTION_SERVER } from 'next/constants.js'

export default async (phase) => {
    if (phase === PHASE_PRODUCTION_SERVER) {
        return { /* your nextjs config */ }
    }

    // Lazy load modules we require for the compilation only.
    // This way we can later omit the package for production
    
    const transpileVendorStyles = await import('@freshcells/next-transpile-vendor-styles')

    return withTransform = transpileVendorStyles.default([
        '@your-namespace/module-1',
        '@your-namespace/module-2'
    ])
    
    return withTransform({
        /* your nextjs config */
    })
}
1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago