refactor(tasks): clean up
This commit is contained in:
Generated
+10
-12230
File diff suppressed because it is too large
Load Diff
+5
-8
@@ -12,11 +12,11 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
|
"build": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
|
||||||
"start": "rollup -w -c",
|
"start": "rollup -w -c",
|
||||||
"start:examples": "rollup -c rollup.examples.js -w",
|
"start:examples": "cd example && npm start",
|
||||||
"build:examples": "rollup -c rollup.examples.js --environment NODE_ENV:production",
|
"build:examples": "cd example && npm run build",
|
||||||
"dev": "npm run start:examples",
|
"dev": "npm run build && npm run start && npm run start:examples",
|
||||||
"start:testserver": "rollup -c --environment NODE_ENV:testing && rollup -c rollup.examples.js -w --environment NODE_ENV:testing",
|
"start:testserver": "npm run build && npm run start:examples",
|
||||||
"build:dev": "npm install && npm run build:examples",
|
"build:dev": "npm install && cd example && npm install && npm run build",
|
||||||
"dev:wait": "start-server-and-test start:testserver http-get://localhost:3000",
|
"dev:wait": "start-server-and-test start:testserver http-get://localhost:3000",
|
||||||
"test": "npm run dev:wait test:chrome",
|
"test": "npm run dev:wait test:chrome",
|
||||||
"test:chrome": "cypress run --browser chrome --headless",
|
"test:chrome": "cypress run --browser chrome --headless",
|
||||||
@@ -57,8 +57,6 @@
|
|||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"babel-preset-react-app": "^10.0.0",
|
"babel-preset-react-app": "^10.0.0",
|
||||||
"cypress": "^6.5.0",
|
"cypress": "^6.5.0",
|
||||||
"dagre": "^0.8.5",
|
|
||||||
"localforage": "^1.9.0",
|
|
||||||
"postcss": "^8.2.6",
|
"postcss": "^8.2.6",
|
||||||
"postcss-cli": "^8.3.1",
|
"postcss-cli": "^8.3.1",
|
||||||
"postcss-nested": "^5.0.3",
|
"postcss-nested": "^5.0.3",
|
||||||
@@ -66,7 +64,6 @@
|
|||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"react": "^17.0.1",
|
"react": "^17.0.1",
|
||||||
"react-dom": "^17.0.1",
|
"react-dom": "^17.0.1",
|
||||||
"react-router-dom": "^5.2.0",
|
|
||||||
"release-it": "^14.4.1",
|
"release-it": "^14.4.1",
|
||||||
"rollup": "^2.39.0",
|
"rollup": "^2.39.0",
|
||||||
"rollup-plugin-bundle-size": "^1.0.3",
|
"rollup-plugin-bundle-size": "^1.0.3",
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
import path from 'path';
|
|
||||||
import resolve from '@rollup/plugin-node-resolve';
|
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
|
||||||
import babel from '@rollup/plugin-babel';
|
|
||||||
import alias from '@rollup/plugin-alias';
|
|
||||||
import replace from '@rollup/plugin-replace';
|
|
||||||
import postcss from 'rollup-plugin-postcss';
|
|
||||||
import livereload from 'rollup-plugin-livereload';
|
|
||||||
import serve from 'rollup-plugin-serve';
|
|
||||||
|
|
||||||
import { baseConfig } from './rollup.config.js';
|
|
||||||
|
|
||||||
const isProd = process.env.NODE_ENV === 'production';
|
|
||||||
const isTesting = process.env.NODE_ENV === 'testing';
|
|
||||||
|
|
||||||
const serveFiles = !isProd || isTesting;
|
|
||||||
const doLiveReload = !isProd && !isTesting;
|
|
||||||
|
|
||||||
const rollupExamplesConfig = {
|
|
||||||
input: 'example/src/index.js',
|
|
||||||
output: [
|
|
||||||
{
|
|
||||||
dir: 'example/public/dist',
|
|
||||||
format: 'iife',
|
|
||||||
sourcemap: !isProd,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
plugins: [
|
|
||||||
replace({
|
|
||||||
'process.env.NODE_ENV': isProd ? JSON.stringify('production') : JSON.stringify('development'),
|
|
||||||
'process.env.FORCE_SIMILAR_INSTEAD_OF_MAP': false,
|
|
||||||
}),
|
|
||||||
postcss({
|
|
||||||
modules: false,
|
|
||||||
}),
|
|
||||||
alias({
|
|
||||||
entries: [{ find: 'react-flow-renderer', replacement: path.resolve(__dirname, 'dist', 'ReactFlow.esm.js') }],
|
|
||||||
}),
|
|
||||||
babel({
|
|
||||||
exclude: 'node_modules/**',
|
|
||||||
babelHelpers: 'runtime',
|
|
||||||
}),
|
|
||||||
resolve(),
|
|
||||||
commonjs({
|
|
||||||
include: 'node_modules/**',
|
|
||||||
}),
|
|
||||||
serveFiles &&
|
|
||||||
serve({
|
|
||||||
open: true,
|
|
||||||
port: 3000,
|
|
||||||
contentBase: 'example/public/',
|
|
||||||
historyApiFallback: true,
|
|
||||||
}),
|
|
||||||
doLiveReload && livereload(),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default isTesting ? rollupExamplesConfig : [baseConfig(), rollupExamplesConfig];
|
|
||||||
Reference in New Issue
Block a user