refactor(tasks): clean up

This commit is contained in:
moklick
2021-02-23 18:58:23 +01:00
parent 20309d4e38
commit 2e934d2233
3 changed files with 15 additions and 12296 deletions
+10 -12230
View File
File diff suppressed because it is too large Load Diff
+5 -8
View File
@@ -12,11 +12,11 @@
"scripts": {
"build": "rollup -c --environment NODE_ENV:production && postcss src/*.css --dir dist",
"start": "rollup -w -c",
"start:examples": "rollup -c rollup.examples.js -w",
"build:examples": "rollup -c rollup.examples.js --environment NODE_ENV:production",
"dev": "npm run start:examples",
"start:testserver": "rollup -c --environment NODE_ENV:testing && rollup -c rollup.examples.js -w --environment NODE_ENV:testing",
"build:dev": "npm install && npm run build:examples",
"start:examples": "cd example && npm start",
"build:examples": "cd example && npm run build",
"dev": "npm run build && npm run start && npm run start:examples",
"start:testserver": "npm run build && npm run start:examples",
"build:dev": "npm install && cd example && npm install && npm run build",
"dev:wait": "start-server-and-test start:testserver http-get://localhost:3000",
"test": "npm run dev:wait test:chrome",
"test:chrome": "cypress run --browser chrome --headless",
@@ -57,8 +57,6 @@
"autoprefixer": "^10.2.4",
"babel-preset-react-app": "^10.0.0",
"cypress": "^6.5.0",
"dagre": "^0.8.5",
"localforage": "^1.9.0",
"postcss": "^8.2.6",
"postcss-cli": "^8.3.1",
"postcss-nested": "^5.0.3",
@@ -66,7 +64,6 @@
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"release-it": "^14.4.1",
"rollup": "^2.39.0",
"rollup-plugin-bundle-size": "^1.0.3",
-58
View File
@@ -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];