mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Removed rollup for components.
This commit is contained in:
parent
b9a0f0442e
commit
69b9458975
@ -1,2 +0,0 @@
|
||||
export * from 'components/pages/settings/teams/TeamAddForm';
|
||||
export * from 'components/pages/settings/teams/TeamAddWebsiteForm';
|
@ -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,
|
||||
},
|
||||
}),
|
||||
],
|
||||
],
|
||||
};
|
||||
|
@ -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];
|
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user