mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 08:57:54 +00:00
WIP monorepo
Following https://dev.to/ynwd/how-to-create-react-monorepo-with-npm-workspace-webpack-and-create-react-app-2dhn
This commit is contained in:
1 parent
a21568d918
commit
dbbf2566c8
5 files changed
+2711
No files matched your search
@@ -0,0 +1,14 @@
|
||||
// babel.config.js
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-react",
|
||||
{
|
||||
targets: {
|
||||
node: "current",
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
};
|
||||
|
||||
Generated
+2635
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "components",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-react": "^7.16.7",
|
||||
"babel-loader": "^8.2.3",
|
||||
"webpack": "^5.68.0",
|
||||
"webpack-cli": "^4.9.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// src/index.js
|
||||
import React from "react"
|
||||
|
||||
const Header = ({ text = "" }) => {
|
||||
return (
|
||||
<h1>Shared header library {text}</h1>
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
Header
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// webpack.config.js
|
||||
const path = require("path")
|
||||
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
entry: {
|
||||
index: { import: "./src/index.js" }
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
loader: "babel-loader",
|
||||
},
|
||||
],
|
||||
},
|
||||
output: {
|
||||
filename: "components.bundle.min.js",
|
||||
library: 'fstrComponents',
|
||||
libraryTarget: 'umd',
|
||||
clean: true
|
||||
},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user