package / lerna config
This commit is contained in:
parent
0468ef55c7
commit
0332ffe099
21
package.json
21
package.json
|
@ -17,15 +17,20 @@
|
|||
"@babel/preset-env": "^7.8.4",
|
||||
"babel-eslint": "^10.0.3",
|
||||
"babel-jest": "24.9.0",
|
||||
"babel-loader": "^8.0.6",
|
||||
"cross-env": "^7.0.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-standard": "^4.0.1",
|
||||
"find-up": "^4.1.0",
|
||||
"jest": "24.9.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^3.0.1",
|
||||
"lerna": "^3.20.2"
|
||||
"lerna": "^3.20.2",
|
||||
"webpack": "^4.41.6",
|
||||
"webpack-cli": "^3.3.11",
|
||||
"webpack-bundle-analyzer": "^3.4.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.8.4",
|
||||
|
@ -33,10 +38,18 @@
|
|||
"core-js": "^3.6.4"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "lerna run --parallel 'build'",
|
||||
"build": "run-s build:packages",
|
||||
"build:packages": "lerna run --ignore subspace-docs --stream build",
|
||||
"build:site": "lerna run --scope subspace-docs --stream build",
|
||||
"clean": "lerna run --parallel clean",
|
||||
"lerna:bootstrap": "lerna bootstrap",
|
||||
"bootstrap": "npm-run-all lerna:bootstrap build",
|
||||
"ganache": "ganache-cli -s 0 -b 5",
|
||||
"lint": "cross-env eslint 'packages/**/*.js{,x}'"
|
||||
"lint": "cross-env eslint 'packages/**/*.js{,x}'",
|
||||
"test": "lerna run --stream test"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.17.0",
|
||||
"npm": ">=6.11.3",
|
||||
"yarn": ">=1.19.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
engine-strict = true
|
||||
package-lock = false
|
||||
scripts-prepend-node-path = true
|
|
@ -3,7 +3,7 @@ module.exports = api => {
|
|||
|
||||
return {
|
||||
env: {
|
||||
development: {
|
||||
node: {
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
|
|
|
@ -24,17 +24,24 @@
|
|||
"url": "https://github.com/embarklabs/subspace/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"browser": "./lib/index.js",
|
||||
"module": "./module/index.js",
|
||||
"main": "./dist/node/index.js",
|
||||
"browser": "./dist/browser/index.js",
|
||||
"module": "./dist/module/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist; rimraf lib; rimraf module;",
|
||||
"build:browser": "cross-env BABEL_ENV=browser babel ./src --out-dir ./lib --source-maps --copy-files",
|
||||
"build:module": "cross-env BABEL_ENV=module babel ./src --out-dir ./module --source-maps --copy-files",
|
||||
"build:node": "babel ./src --out-dir ./dist --source-maps --copy-files",
|
||||
"analyze": "cross-env WEBPACK_ANALYZE=t npm run build:umd",
|
||||
"clean": "rimraf dist;",
|
||||
"build": "npm-run-all clean build:*",
|
||||
"test": "jest"
|
||||
"build:browser": "cross-env BABEL_ENV=browser babel ./src --out-dir ./dist/browser --source-maps --copy-files",
|
||||
"build:module": "cross-env BABEL_ENV=module babel ./src --out-dir ./dist/module --source-maps --copy-files",
|
||||
"build:node": "cross-env BABEL_ENV=node babel ./src --out-dir ./dist/dist/node --source-maps --copy-files",
|
||||
"build:umd": "cross-env BABEL_ENV=module webpack",
|
||||
"test": "jest",
|
||||
"watch": "yarn run-p watch:*",
|
||||
"watch:node": "yarn run build:node -- --verbose --watch",
|
||||
"watch:browser": "yarn run build:browser -- --verbose --watch",
|
||||
"watch:module": "yarn run build:module -- --verbose --watch",
|
||||
"watch:umd": "yarn run build:umd -- --info-verbosity verbose --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ganache-core": "^2.10.1",
|
||||
|
@ -70,5 +77,10 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.17.0",
|
||||
"npm": ">=6.11.3",
|
||||
"yarn": ">=1.19.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
const {join} = require("path");
|
||||
const {sync: findUp} = require("find-up");
|
||||
|
||||
/* eslint-disable import/no-dynamic-require */
|
||||
const config = require(
|
||||
findUp("webpack.config.js", {cwd: join(__dirname, '..')})
|
||||
);
|
||||
|
||||
config.entry = join(__dirname, "src/index.js");
|
||||
config.output.filename = "subspace.min.js";
|
||||
config.output.path = __dirname + "/dist/umd/";
|
||||
config.output.library = "Subspace";
|
||||
config.output.libraryExport = "default";
|
||||
|
||||
module.exports = config;
|
|
@ -3,7 +3,7 @@ module.exports = api => {
|
|||
|
||||
return {
|
||||
env: {
|
||||
development: {
|
||||
node: {
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
|
|
|
@ -25,15 +25,23 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"types": "types/index.d.ts",
|
||||
"main": "./dist/index.js",
|
||||
"browser": "./lib/index.js",
|
||||
"module": "./module/index.js",
|
||||
"main": "./dist/node/index.js",
|
||||
"browser": "./dist/browser/index.js",
|
||||
"module": "./dist/module/index.js",
|
||||
"scripts": {
|
||||
"clean": "rimraf lib; rimraf module;",
|
||||
"build:browser": "cross-env BABEL_ENV=browser babel ./src --out-dir ./lib --source-maps --copy-files",
|
||||
"build:module": "cross-env BABEL_ENV=module babel ./src --out-dir ./module --source-maps --copy-files",
|
||||
"build:node": "babel ./src --out-dir ./dist --source-maps --copy-files",
|
||||
"build": "npm-run-all clean build:*"
|
||||
"analyze": "cross-env WEBPACK_ANALYZE=t npm run build:umd",
|
||||
"clean": "rimraf dist;",
|
||||
"build": "npm-run-all clean build:*",
|
||||
"build:browser": "cross-env BABEL_ENV=browser babel ./src --out-dir ./dist/browser --source-maps --copy-files",
|
||||
"build:module": "cross-env BABEL_ENV=module babel ./src --out-dir ./dist/module --source-maps --copy-files",
|
||||
"build:node": "cross-env BABEL_ENV=node babel ./src --out-dir ./dist/dist/node --source-maps --copy-files",
|
||||
"build:umd": "cross-env BABEL_ENV=module webpack",
|
||||
"test": "jest",
|
||||
"watch": "yarn run-p watch:*",
|
||||
"watch:node": "yarn run build:node -- --verbose --watch",
|
||||
"watch:browser": "yarn run build:browser -- --verbose --watch",
|
||||
"watch:module": "yarn run build:module -- --verbose --watch",
|
||||
"watch:umd": "yarn run build:umd -- --info-verbosity verbose --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"react": "^16.9.0",
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
const {join} = require("path");
|
||||
const {sync: findUp} = require("find-up");
|
||||
|
||||
/* eslint-disable import/no-dynamic-require */
|
||||
const config = require(
|
||||
findUp("webpack.config.js", {cwd: join(__dirname, '..')})
|
||||
);
|
||||
|
||||
config.externals = {
|
||||
"@embarklabs/subspace": "Subspace",
|
||||
react: {
|
||||
commonjs: 'react',
|
||||
commonjs2: 'react',
|
||||
amd: 'React',
|
||||
root: 'React',
|
||||
},
|
||||
'react-dom': {
|
||||
commonjs: 'react-dom',
|
||||
commonjs2: 'react-dom',
|
||||
amd: 'ReactDOM',
|
||||
root: 'ReactDOM',
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: set subspace as a dependency
|
||||
|
||||
config.entry = join(__dirname, "src/index.js");
|
||||
config.output.filename = "subspace-react.min.js";
|
||||
config.output.path = __dirname + "/dist/umd/";
|
||||
config.output.library = "SubspaceReact";
|
||||
config.output.libraryExport = "default";
|
||||
|
||||
module.exports = config;
|
|
@ -0,0 +1,47 @@
|
|||
const {BundleAnalyzerPlugin} = require("webpack-bundle-analyzer");
|
||||
|
||||
const config = {
|
||||
devtool: "source-map",
|
||||
/* entry: ..., */
|
||||
mode: "production",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js?$/,
|
||||
exclude: /(node_modules)/,
|
||||
use: [
|
||||
{
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
rootMode: "upward"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
output: {
|
||||
/* filename: ..., */
|
||||
globalObject: "this",
|
||||
/* path: ..., */
|
||||
/* library: ..., */
|
||||
libraryTarget: "umd"
|
||||
},
|
||||
plugins: [],
|
||||
resolve: {
|
||||
extensions: [
|
||||
// webpack defaults
|
||||
// see: https://webpack.js.org/configuration/resolve/#resolveextensions
|
||||
".wasm", ".mjs", ".js", ".json",
|
||||
// additional extensions
|
||||
".jsx"
|
||||
]
|
||||
},
|
||||
target: "web",
|
||||
};
|
||||
|
||||
if (process.env.WEBPACK_ANALYZE) {
|
||||
config.plugins.push(new BundleAnalyzerPlugin());
|
||||
}
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in New Issue