Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: feat: swc has already updated, support mako bundler #776

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion boilerplate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-father",
"version": "4.5.0",
"version": "4.5.0-rc.2",
"description": "Creator for father boilerplate",
"homepage": "https://github.com/umijs/father/tree/master/boilerplate#readme",
"bugs": "https://github.com/umijs/father/issues",
Expand Down
14 changes: 14 additions & 0 deletions examples/mako/.fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from '../../dist';
const path = require('path');

export default defineConfig({
umd: {
bundler: 'mako',
},
alias: {
'@': path.resolve(__dirname, './src'),
'hello-a': path.resolve(__dirname, './src/a.tsx'),
'hello-foo': path.resolve(__dirname, './src/foo.ts'),
},
platform: 'browser',
});
3 changes: 3 additions & 0 deletions examples/mako/mako.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"hmr": false
}
15 changes: 15 additions & 0 deletions examples/mako/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scripts": {
"build": "father build",
"build:no-clean": "father build --no-clean",
"dev": "father dev",
"dev:no-clean": "father dev --no-clean",
"doctor": "father doctor",
"version": "father version"
},
"dependencies": {
"father": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
}
}
15 changes: 15 additions & 0 deletions examples/mako/src/a.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
console.log('hello here');

// @ts-ignore
import React from 'react';
// @ts-ignore
import ReactDOM from 'react-dom';

function App({content}:{content:string}) {
// @ts-ignore
return <div>{content}</div>;
}

// @ts-ignore
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App content={'hello'}/>);
7 changes: 7 additions & 0 deletions examples/mako/src/content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Content {
say() {
return 'Hello father';
}
}

export default new Content().say();
1 change: 1 addition & 0 deletions examples/mako/src/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('foo here');
27 changes: 27 additions & 0 deletions examples/mako/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import content from '@/content';
import 'hello-a'
import 'hello-foo'










/*
import React from 'react';
import ReactDOM from 'react-dom';

// const content = 'Hello'
function App() {
return <div>{content}</div>;
}

// @ts-ignore
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App />);
*/
console.log(content);
19 changes: 19 additions & 0 deletions examples/mako/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"skipLibCheck": true,
"target": "es2015",
"jsx": "react",
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "father",
"version": "4.5.0",
"version": "4.5.0-rc.2",
"description": "A bundless/bundle build tool",
"homepage": "https://github.com/umijs/father#readme",
"bugs": "https://github.com/umijs/father/issues",
Expand Down Expand Up @@ -44,6 +44,7 @@
"dependencies": {
"@microsoft/api-extractor": "7.39.1",
"@umijs/babel-preset-umi": "^4.3.12",
"@umijs/bundler-mako": "0.8.7",
"@umijs/bundler-utils": "^4.3.12",
"@umijs/bundler-webpack": "^4.3.12",
"@umijs/case-sensitive-paths-webpack-plugin": "^1.0.1",
Expand All @@ -67,22 +68,22 @@
"v8-compile-cache": "2.3.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
"@swc/core": "^1.3.53",
"@types/jest": "^27",
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@swc/core": "^1.5.24",
"@types/jest": "^27.5.2",
"@types/loader-runner": "2.2.4",
"@types/minimatch": "3.0.5",
"@types/node": "^18.15.13",
"@umijs/test": "^4.0.68",
"git-repo-info": "^2.1.1",
"husky": "^8.0.3",
"jest": "^27",
"jest": "^27.5.1",
"jest-mock-process": "^1.5.1",
"lint-staged": "^13.2.1",
"prettier": "^2.8.7",
"prettier-plugin-organize-imports": "^3.2.2",
"prettier-plugin-packagejson": "^2.4.3",
"lint-staged": "^13.3.0",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-packagejson": "^2.5.0",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"tsx": "^4.16.3",
Expand Down
Loading
Loading