Skip to content

Commit

Permalink
chore: finish plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Oct 24, 2024
1 parent 9a1b2b9 commit e4e1724
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 175 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/refactor-react/farm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from "@farmfe/core";

import react from "@farmfe/plugin-react";
import path from "path";

console.log(__dirname);

export default defineConfig({
plugins: [
react(),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"dotenv-expand": "^11.0.6",
"execa": "8.0.0",
"farm-browserslist-generator": "^1.0.5",
"farm-plugin-replace-dirname": "0.2.1",
"@farmfe/plugin-replace-dirname": "workspace:*",
"fast-glob": "^3.3.2",
"fs-extra": "^11.1.1",
"is-plain-object": "^5.0.0",
Expand Down
9 changes: 4 additions & 5 deletions packages/core/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,15 +665,14 @@ export async function readConfigFile(
mode
});

// const replaceDirnamePlugin = await import('farm-plugin-replace-dirname').then(
// (mod) => mod.default
// );
const replaceDirnamePlugin = await import(
'@farmfe/plugin-replace-dirname'
).then((mod) => mod.default);

const compiler = new Compiler({
compilation: normalizedConfig,
jsPlugins: [],
// rustPlugins: [[replaceDirnamePlugin, '{}']]
rustPlugins: []
rustPlugins: [[replaceDirnamePlugin, '{}']]
});

const FARM_PROFILE = process.env.FARM_PROFILE;
Expand Down
106 changes: 3 additions & 103 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust-plugins/replace-dirname/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
edition = "2021"
name = "farm_plugin_replace_dirname"
name = "farmfe_plugin_replace_dirname"
version = "0.0.0"

[lib]
Expand Down
3 changes: 0 additions & 3 deletions rust-plugins/replace-dirname/func.js

This file was deleted.

12 changes: 8 additions & 4 deletions rust-plugins/replace-dirname/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
export interface SassOptions {
export interface IOptions {
/**
* Add extra content to the head of each sass file, such as an @import '@/styles/variables.scss'; statement.
* The path to the root of the project
*/
additionalData?: string;
include?: string[];
/**
* exclude the path from the project
*/
exclude?: string[];
}

declare const binPath: (options?: SassOptions) => [string, typeof options];
const binPath: string;
export default binPath;
Loading

0 comments on commit e4e1724

Please sign in to comment.