Skip to content

Commit

Permalink
Move app to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
brijeshb42 committed Jul 15, 2024
1 parent 15c06f8 commit c16770e
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 1,153 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"preview": "vite preview"
},
"dependencies": {
"@pigment-css/react": "workspace:^",
"@pigment-css/react": "latest",
"react": "latest",
"react-dom": "latest"
},
"devDependencies": {
"@pigment-css/unplugin": "workspace:^",
"@pigment-css/unplugin": "latest",
"@types/react": "latest",
"@types/react-dom": "latest",
"css-loader": "^7.1.2",
Expand All @@ -24,19 +24,5 @@
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
},
"nx": {
"targets": {
"preview": {
"dependsOn": [
"^build"
]
},
"dev": {
"dependsOn": [
"^build"
]
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
transform,
createFileReporter,
} from '@wyw-in-js/transform';
import { asyncResolveFallback } from '@wyw-in-js/shared';
import { asyncResolveFallback, slugify } from '@wyw-in-js/shared';
import {
UnpluginFactoryOutput,
WebpackPluginInstance,
Expand Down Expand Up @@ -325,8 +325,9 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {
}

const rootPath = process.cwd();
const slug = slugify(cssText);
const cssFilename = path
.normalize(`${id.replace(/\.[jt]sx?$/, '')}.pigment.css`)
.normalize(`${id.replace(/\.[jt]sx?$/, '')}-${slug}.pigment.css`)
.replace(/\\/g, path.posix.sep);

const cssRelativePath = path.relative(rootPath, cssFilename).replace(/\\/g, path.posix.sep);
Expand Down
Loading

0 comments on commit c16770e

Please sign in to comment.