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

@1xinternet/editable-webpack-config

v1.4.4

Published

Provides a reusable build configuration for Drupal Editable JS libraries

Downloads

30

Readme

Reusable build configuration for Drupal Editable JS libraries

This module contains webpack config factory function for Drupal Editable modules.

It uses the config key from the package.json of the module and the NODE_ENV flag to build the correct webpack configuration.

Example usage

(project package.json)

{
  "scripts": {
    "build": "npm run build:dev && npm run build:prod",
    "build:dev": "NODE_ENV=development webpack --config ./node_modules/@1xinternet/editable-webpack-config",
    "build:prod": "NODE_ENV=production webpack --config ./node_modules/@1xinternet/editable-webpack-config"
  },
  "config": {
    "namespace": "MyCustomNameSpace",
    "bundleName": "file_name_for_the_bundle",
    "isEditableRoot": "false",
    "externals": {
      "EditableBaseComponents": "@1xinternet/editable-base-components"
    }
  }
}

Code entry is at ./src/index.js – bundle files will be named after bundleNameand written to ./dist/

externals is merged into the externals config of webpack. These libraries can be required in the library but will not be part of the built bundle. They are expected to be available within the global namespace.

isEditableRoot flag

This flag is only required for the root editable JS library. It enables exposing some libraries to the global namespace. This is not needed for any other libraries depending on the core/root library! (simply remove this key)

Installation

The webpack config requires some libraries to be installed. Install them with this command:

npm i -D @babel/core @babel/plugin-proposal-class-properties @babel/plugin-syntax-export-default-from @babel/preset-env @babel/preset-react babel-loader react-dev-utils webpack webpack-cli

If you get an error from babel, this might be due to modules depending on the old version of babel-core. To fix this, try:

npm i -D babel-core@^7.0.0-bridge.0