1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const tslib_1 = require("tslib");
|
4 | const dedent_1 = tslib_1.__importDefault(require("dedent"));
|
5 | exports.defaults = {
|
6 | watch: false,
|
7 | inputDirectory: 'src',
|
8 | outputDirectory: 'dist',
|
9 | cssMain: 'main.css',
|
10 | ignore: [
|
11 | '**/*.+(md|mdx)',
|
12 | '**/__tests__/**',
|
13 | '**/__snapshots__/**',
|
14 | '**/*.+(stories|test).*'
|
15 | ]
|
16 | };
|
17 | const command = {
|
18 | name: 'build',
|
19 | description: 'Builds a React Component located in `./src` and outputs `cjs`, `mjs`, and `css` into `dist`',
|
20 | options: [
|
21 | {
|
22 | name: 'watch',
|
23 | alias: 'w',
|
24 | type: Boolean,
|
25 | description: 'Watch for file changes and recompile.'
|
26 | },
|
27 | {
|
28 | name: 'ignore',
|
29 | type: String,
|
30 | multiple: true,
|
31 | description: 'A minimatch to ignore',
|
32 | defaultValue: exports.defaults.ignore,
|
33 | config: true
|
34 | }
|
35 | ],
|
36 | footer: [
|
37 | {
|
38 | header: 'Custom Babel Config',
|
39 | content: 'To customize your babel configuration, create a .babelrc at the root of the project.'
|
40 | },
|
41 | {
|
42 | header: 'Custom PostCSS Config',
|
43 | content: [
|
44 | dedent_1.default `
|
45 | To customize your postcss configuration, create a postcss.config.js at your package or monorepo root.
|
46 |
|
47 | It must use the base config for css modules to function properly.
|
48 | `
|
49 | ]
|
50 | },
|
51 | {
|
52 | code: true,
|
53 | content: dedent_1.default `
|
54 | \`\`\`js
|
55 | const defaultConfig = require('@design-systems/build/postcss.config');
|
56 | const mixins = require('postcss-mixins');
|
57 |
|
58 | module.exports = (ctx) => {
|
59 | const config = defaultConfig(ctx);
|
60 |
|
61 | return {
|
62 | ...config,
|
63 | plugins: [
|
64 | mixins({ mixinsFiles }),
|
65 | ...config.plugins
|
66 | ]
|
67 | }
|
68 | });
|
69 | \`\`\`
|
70 | `
|
71 | }
|
72 | ]
|
73 | };
|
74 | exports.default = command;
|
75 |
|
\ | No newline at end of file |