Removed rollup for components.

This commit is contained in:
Mike Cao 2023-04-21 13:16:54 -07:00
parent b9a0f0442e
commit 69b9458975
4 changed files with 21 additions and 106 deletions

View File

@ -1,2 +0,0 @@
export * from 'components/pages/settings/teams/TeamAddForm';
export * from 'components/pages/settings/teams/TeamAddWebsiteForm';

View File

@ -1,17 +1,17 @@
const flexBugs = require('postcss-flexbugs-fixes');
const presetEnv = require('postcss-preset-env');
module.exports = {
plugins: [
flexBugs,
presetEnv({
autoprefixer: {
flexbox: 'no-2009',
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
features: {
'custom-properties': false,
},
},
stage: 3,
features: {
'custom-properties': false,
},
}),
],
],
};

View File

@ -1,90 +0,0 @@
import path from 'path';
import crypto from 'crypto';
import resolve from '@rollup/plugin-node-resolve';
import alias from '@rollup/plugin-alias';
import postcss from 'rollup-plugin-postcss';
import del from 'rollup-plugin-delete';
import esbuild from 'rollup-plugin-esbuild';
import dts from 'rollup-plugin-dts';
import svgr from '@svgr/rollup';
import externals from 'rollup-plugin-node-externals';
import json from '@rollup/plugin-json';
const md5 = str => crypto.createHash('md5').update(str).digest('hex');
const aliases = [
{ find: /^components/, replacement: path.resolve('./components') },
{ find: /^hooks/, replacement: path.resolve('./hooks') },
{ find: /^assets/, replacement: path.resolve('./assets') },
{ find: /^lib/, replacement: path.resolve('./lib') },
{ find: /^store/, replacement: path.resolve('./store') },
{ find: /^public/, replacement: path.resolve('./public') },
];
const aliasResolver = resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
});
const jsBundle = {
input: 'components/index.ts',
output: [
{
file: 'dist/index.js',
format: 'cjs',
sourcemap: true,
},
{
file: 'dist/index.mjs',
format: 'es',
sourcemap: true,
},
],
plugins: [
del({ targets: 'dist/*', runOnce: true }),
postcss({
extract: 'styles.css',
sourceMap: true,
minimize: true,
modules: {
generateScopedName: function (name, filename, css) {
const file = path.basename(filename, '.css').replace('.module', '');
const hash = Buffer.from(md5(`${name}:${filename}:${css}`))
.toString('base64')
.substring(0, 5);
return `${file}-${name}--${hash}`;
},
},
}),
svgr({ icon: true }),
externals(),
alias({
entries: aliases,
customResolver: aliasResolver,
}),
json(),
esbuild({
loaders: {
'.js': 'jsx',
},
}),
],
};
const dtsBundle = {
input: 'components/index.ts',
output: {
file: 'dist/index.d.ts',
format: 'es',
},
plugins: [
alias({
entries: aliases,
customResolver: aliasResolver,
}),
externals(),
dts(),
],
};
export default [jsBundle, dtsBundle];

View File

@ -14,11 +14,18 @@
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"jsx": "react-jsx",
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"skipLibCheck": true,
"baseUrl": ".",
"paths": { "*": ["./*"] }
"paths": {
"*": ["./*"]
},
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["next-env.d.ts", "**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]