Commit 1d342d08 authored by poppydani's avatar poppydani

feat: init project

parents
node_modules/
.DS_Store
*.log
.vscode
.idea
dist
.cache
*.error
\ No newline at end of file
{
"name": "root",
"private": true,
"scripts": {
"bootstrap": "lerna bootstrap",
"dev": "cross-env NODE_ENV=development lerna exec --parallel -- rollup -c ../../rollup.config.js --watch",
"build": "cross-env NODE_ENV=production lerna exec -- rollup -c ../../rollup.config.js",
"clean": "lerna run --parallel clean && lerna clean --yes",
"format": "prettier --write 'packages/**/*.{js,ts,md,json}'",
"publish:cdn": "node scripts/publish-cdn.js magnet",
"publish-wrap": "node scripts/publish-cdn.js wrap",
"publish-visual": "node scripts/publish-cdn.js visual"
},
"devDependencies": {
"cross-env": "^7.0.3",
"lerna": "^4.0.0"
},
"dependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"rollup": "^2.61.1",
"rollup-plugin-terser": "^7.0.2"
},
"workspaces": [
"packages/*"
]
}
# `webpack-assets-replace-plugin`
> TODO: description
## Usage
```
const webpackAssetsReplacePlugin = require('webpack-assets-replace-plugin');
// TODO: DEMONSTRATE API
```
'use strict';
const webpackAssetsReplacePlugin = require('..');
describe('webpack-assets-replace-plugin', () => {
it('needs tests');
});
'use strict';
module.exports = webpackAssetsReplacePlugin;
function webpackAssetsReplacePlugin() {
// TODO
}
{
"name": "@credits/webpack-assets-replace-plugin",
"version": "0.0.0",
"description": "> TODO: description",
"keywords": [
"webpack",
"plugin"
],
"author": "jiangdandan <jiangdandan@duiba.com.cn>",
"homepage": "",
"license": "ISC",
"main": "dist/webpack-assets-replace-plugin.min.js",
"module": "dist/webpack-assets-replace-plugin.es.js",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"publishConfig": {
"registry": "http://npm.dui88.com:80/"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1"
}
}
const path = require('path');
const resolve = require('@rollup/plugin-node-resolve').default;
// const ts = require('rollup-plugin-typescript2');
const json = require('@rollup/plugin-json');
const commonjs = require('@rollup/plugin-commonjs');
const { terser } = require('rollup-plugin-terser');
// const postcss = require('rollup-plugin-postcss');
const pkg = require(path.resolve('./package.json'));
const name = pkg.name.replace('@credits/', '');
const config = {
input: path.resolve(`./lib/${name}.js`),
output: [
{
file: path.resolve(`./dist/${name}.min.js`),
format: 'umd',
name: name
},
{
file: path.resolve(`./dist/${name}.es.js`),
format: 'es'
},
{
file: path.resolve(`./dist/${name}.cjs.js`),
format: 'cjs'
}
],
plugins: [
// postcss({
// extensions: ['.css']
// }),
resolve({ extensions: ['ts', 'js'] }),
// ts({ tsconfig: path.resolve('./tsconfig.json') }),
commonjs(),
json(),
process.env.NODE_ENV === 'production' && terser()
]
};
module.exports = config;
{
"compilerOptions": {
"baseUrl": "./packages",
// Project Options
"allowJs": false, // https://www.typescriptlang.org/zh/tsconfig#allowJs
"checkJs": false, // https://www.typescriptlang.org/zh/tsconfig#checkJs
"declaration": true, // https://www.typescriptlang.org/zh/tsconfig#declaration
"declarationMap": true, // https://www.typescriptlang.org/zh/tsconfig#declarationMap
"jsx": "react-jsx", // https://www.typescriptlang.org/zh/tsconfig#jsx
"lib": [
"ESNext",
"DOM"
], // https://www.typescriptlang.org/zh/tsconfig#lib
"module": "ESNext", // https://www.typescriptlang.org/zh/tsconfig#module
"noEmit": true, // https://www.typescriptlang.org/zh/tsconfig#noEmit
"removeComments": false, // https://www.typescriptlang.org/zh/tsconfig#removeComments
"sourceMap": false, // https://www.typescriptlang.org/zh/tsconfig#sourceMap
"target": "ES5", // https://www.typescriptlang.org/zh/tsconfig#target
// Strict Checks
"noImplicitAny": true, // https://www.typescriptlang.org/zh/tsconfig#noImplicitAny
"noImplicitThis": false, // https://www.typescriptlang.org/zh/tsconfig#noImplicitThis
"strict": true, // https://www.typescriptlang.org/zh/tsconfig#strict
"strictBindCallApply": true, // https://www.typescriptlang.org/zh/tsconfig#strictBindCallApply
"strictFunctionTypes": true, // https://www.typescriptlang.org/zh/tsconfig#strictFunctionTypes
"strictNullChecks": true, // https://www.typescriptlang.org/zh/tsconfig#strictNullChecks
"strictPropertyInitialization": false, // https://www.typescriptlang.org/zh/tsconfig#strictPropertyInitialization
// Module Resolution
"allowSyntheticDefaultImports": true, // https://www.typescriptlang.org/zh/tsconfig#allowSyntheticDefaultImports
"esModuleInterop": true, // https://www.typescriptlang.org/zh/tsconfig#esModuleInterop
"moduleResolution": "node", // https://www.typescriptlang.org/zh/tsconfig#moduleResolution
// Linter Checks
"noFallthroughCasesInSwitch": true, // https://www.typescriptlang.org/zh/tsconfig#noFallthroughCasesInSwitch
"noImplicitReturns": true, // https://www.typescriptlang.org/zh/tsconfig#noImplicitReturns
"noUnusedLocals": true, // https://www.typescriptlang.org/zh/tsconfig#noUnusedLocals
"noUnusedParameters": true, // https://www.typescriptlang.org/zh/tsconfig#noUnusedParameters
// Experimental
"emitDecoratorMetadata": true, // https://www.typescriptlang.org/zh/tsconfig#emitDecoratorMetadata
"experimentalDecorators": true, // https://www.typescriptlang.org/zh/tsconfig#experimentalDecorators
// Advanced
"noEmitOnError": true, // https://www.typescriptlang.org/zh/tsconfig#noEmitOnError
"noLib": false, // https://www.typescriptlang.org/zh/tsconfig#noLib
"traceResolution": false, // https://www.typescriptlang.org/zh/tsconfig#traceResolution
"resolveJsonModule": true, // https://www.typescriptlang.org/zh/tsconfig#resolveJsonModule
"skipLibCheck": true, // https://www.typescriptlang.org/zh/tsconfig#skipLibCheck
"paths": {
"@magnet/*": [
"packages/*/lib"
]
}
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment