Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pictogrammers/element-webpack
Shared Element Webpack Config
https://github.com/pictogrammers/element-webpack
Last synced: 7 days ago
JSON representation
Shared Element Webpack Config
- Host: GitHub
- URL: https://github.com/pictogrammers/element-webpack
- Owner: Pictogrammers
- License: mit
- Created: 2022-04-20T03:54:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T17:48:53.000Z (12 months ago)
- Last Synced: 2024-12-08T19:41:19.432Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 366 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Element Webpack Config
Shared webpack configuration for use with `@pictogrammers/element` package.
```javascript
const config = require('@pictogrammers/element-webpack');module.exports = config({
port: 3000,
src: 'src',
dist: 'dist',
watch: [
'src/**/*.md'
],
before: (components, args, mode) => {
console.log(`${components.length} Components`);
},
after: (components, args, mode) => {
// Run after compilation
// components = [
// {
// name,
// input,
// namespace,
// component
// examples: [
// { example, exampleInput },
// ...
// ]
// },
// ...
// ]
// mode = 'production' | 'development'
},
copy: [
{ from: 'src/styles.css', to: 'styles.css' },
]
// Shorthand copy for the above
// copy: [ 'src/styles.css' ]
});
```## Options
| Option | Default | Description |
| ------ | ------- | ----------- |
| `port` | `3000` | localhost port |
| `src` | `src` | Source folder for components, `favicon.svg`, and `index.html` |
| `dist` | `dist` | Distribution folder. Defaults to `dist` |
| `watch` | `[]` | Array of additional files to watch. Glob string format. |
| `copy` | `[]` | Copy over additional folders or files to the `dist` folder. |
| `before` | `null` | Run additional code after before every compilation. |
| `after` | `null` | Run additional code after every compilation. |