npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ecedi/webpack-stack

v1.1.1

Published

Standard webpack stack for drupal 8/9

Downloads

52

Readme

Webpack Stack

Webpack configuration for Drupal 8/9 by ECEDI

Requirements

  • Node 14
  • Webpack installed globally (development instance)

How to install

npm i @ecedi/webpack-stack webpack webpack-cli

cp ./node_modules/@ecedi/webpack-stack/config.example.js config.js

Tips & Tricks

  • Add scripts in your package.json like this:
  "scripts": {
    "build": "webpack --config ./node_modules/@ecedi/webpack-stack/webpack.config.js",
    "watch": "webpack watch --config ./node_modules/@ecedi/webpack-stack/webpack.config.js"
  }

Then run npm run build or npm run watch

  • You can add @ecedi/drupal-js-cli for completed your stack es6 in drupal and with this package you can install all your librairies with NPM

Configuration

All configuration with themes twig, sass and js ... is on config.js, You have access to getFiles() for make array of files recursive

Commands line

| commands\tasks | watch for changes | compile the twig | compile the SCSS | minify the JS | compile the es6 drupal | | --------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | | npm run build | | X | X | X | X | | npm run watch | X | X | X | X | X |

  • npm run build run default task: twig + sassdev
  • npm run watch run default task with watch: twig + sassdev + browser sync

Files

  • webpack.config.js: Webpack main file
  • package.js: main file where global infos and dependencies are declared
  • config.example.js: example of a project config file where path variables are declared
  • .nvmrc: indication of the Node version to use

Developers

if you want to dev this package you need to use --config options for run webpack like this:

webpack --config ${path}/webpack.config.js

Drupal module

For use es6 you need to create a file with *.es6.js which will be compiled in `*.js and which will therefore be your library

Drupal theme

Shared

You must create a shared folder in your example theme themes/custom/yourtheme/js/src/shared and you can import the js that will be created from there using an _shared alias

Theme libraries

You just need to put your js files in the theme src example folder themes/custom/yourtheme/js/src which will then be compiled in the /js of your theme