@studiometa/webpack-config-preset-prototyping
v6.2.2
Published
[![NPM Version](https://img.shields.io/npm/v/@studiometa/webpack-config-preset-prototyping.svg?style=flat-square)](https://www.npmjs.com/package/@studiometa/webpack-config-preset-vue-2)
Downloads
1,389
Maintainers
Readme
@studiometa/webpack-config-preset-prototyping
A preset for @studiometa/webpack-config to add prototyping support to your project. It includes:
- JS or TS
- SCSS and Tailwind CSS
- Twig for templating with file based routing and dynamic data loading
Usage
Install the package:
npm install --save-dev @studiometa/webpack-config-preset-prototyping
And load the preset in the meta.config.js
file:
import { defineConfig } from '@studiometa/webpack-config';
import { prototyping } from '@studiometa/webpack-config-preset-prototyping';
export default defineConfig({
presets: [prototyping()],
// ...
});
Documentation
Options
ts
(boolean
): useapp.ts
as entry point instead ofapp.js
twig
(Object
): options for thetwig
presettailwindcss
(Object
): options for thetailwindcss
presethtml
(Object
): options for thehtml-webpack-plugin
pluginmarkdown
(Object
): options for themarkdown
preset
Examples
Use it in your meta.config.js
file:
import { defineConfig } from '@studiometa/webpack-config';
import { prototyping } from '@studiometa/webpack-config/presets';
export default defineConfig({
presets: [prototyping()],
});
And set up your project with the following folder structure:
meta.config.js
package.json
public/ --> public assets, served from `/`
...
src/
css/ --> css files
app.scss
js/ --> js files
app.js
templates/
components/ --> component files, aliased to `@components`
layouts/ --> layout files, aliased to `@layout`
foo/ --> random files, aliased to `@foo`
pages/
index.twig