Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dulnan/drupal-webpack-setup-example
A simple webpack setup for Drupal themes, with ES6, SCSS, Hot Module Replacement.
https://github.com/dulnan/drupal-webpack-setup-example
Last synced: 3 months ago
JSON representation
A simple webpack setup for Drupal themes, with ES6, SCSS, Hot Module Replacement.
- Host: GitHub
- URL: https://github.com/dulnan/drupal-webpack-setup-example
- Owner: dulnan
- License: mit
- Created: 2018-09-27T16:13:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T17:00:03.000Z (over 6 years ago)
- Last Synced: 2024-10-10T17:40:49.222Z (3 months ago)
- Language: JavaScript
- Size: 65.4 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Drupal Webpack Setup Example
This repository provides a simple example how to build JS and CSS assets with webpack for a Drupal theme.
It uses Drupal's own behavior system, supports Hot Module Replacement (HMR) and compilation of SCSS
(in local dev mode by injection from JavaScript). In production/build mode, CSS is extracted in files.## Setup
```
npm install
```To start the dev server, run:
```
npm run start
```The server runs at http://localhost:9000. But if you follow the configuration in `mytheme.libraries.yml`,
you can use it via your local Drupal URL, something like mydrupalsite.local. Because we define the
webpack dev server URL as an external library in Drupal, features like Hot Module Replacement will
work.[Webpack loader for Drupal behaviors](https://github.com/dulnan/drupal-behaviors-loader)
[Webpack plugin for Drupal.t and Drupal.formatPlural translations](https://github.com/dulnan/drupal-behaviors-loader)