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

lila-webpack-lib-config

v0.6.0

Published

built-in webpack config generator for lila-webpack-lib

Downloads

12

Readme

lila-webpack-lib-config

Built-in webpack config generator for lila-webpack-lib.

install

npm install --save-dev lila-webpack-lib-config

use

In lila.js:

import webpackPlugin from 'lila-webpack-lib';
import webpackConfigPlugin, {forReact, forVue} from 'lila-webpack-lib-config';

export default lila => {
  webpackPlugin(lila);
  webpackConfigPlugin(lila);    // for normal project
  // forReact(lila);            // for react project
  // forVue(lila);              // for vue project

  ...
};

implemented settings of lila-webpack-lib

webpackConfigGenerator: see webpackConfigGenerator

getEntries: see makeGetEntries

all, * means all entries under src(packages if is packages mode) directory.

extended settings

packages: whether use packages mode

type: bool/string default: false

If you want packages mode(see lerna), you can configure lila.setSetting('packages', true).

If so, building structure will be as follows:

- / root
  - packages/ packages directory
    - pkg1/ package 1
      - src/
      - build/
    - pkg2/ package 2
      - src/
      - build/

If you want to customize packages' directory, you can configure lila.setSetting('packages', 'yourCustomDirectory').

extended configs

babelImport: babel-plugin-import config

type: []/{} default: []

example:

{ "libraryName": "antd" }
=>
["import", { "libraryName": "antd" }]


[[{ "libraryName": "antd"}, "ant"]]
=>
["import", { "libraryName": "antd"}, "ant"],


[{ "libraryName": "antd"}, { "libraryName": "antd-mobile"}]
=>
["import", { "libraryName": "antd"}]
["import", { "libraryName": "antd-mobile"}]


[
  [{ "libraryName": "antd"}, "ant"],
  [{ "libraryName": "antd-mobile"}, "antd-mobile"]
]
=>
["import", { "libraryName": "antd"}, "ant"]
["import", { "libraryName": "antd-mobile"}, "antd-mobile"]

babelComponent: babel-plugin-component config

type: []/{} default: []

example:

{ "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }
=>
["component", { "libraryName": "element-ui", "styleLibraryName": "theme-chalk" }]


[[{ "libraryName": "element-ui" }, "element-ui"]]
=>
["component", { "libraryName": "element-ui"}, "element-ui"],


[{ "libraryName": "element-ui"}, { "libraryName": "mint-ui"}]
=>
["component", { "libraryName": "element-ui"}]
["component", { "libraryName": "mint-ui"}]


[
  [{ "libraryName": "element-ui"}, "element-ui"],
  [{ "libraryName": "mint-ui"}, "mint-ui"]
]
=>
["component", { "libraryName": "element-ui"}, "element-ui"]
["component", { "libraryName": "mint-ui"}, "mint-ui"]

babelExclude: babel-loader exclude

type: [] default: [/node_modules/]

babelPresets: extra babel presets

type: [] default: []

babelPlugins: extra babel plugins

type: [] default: []

extensions: url-loader file extensions

type: [] default: ['jpg', 'jpeg', 'png', 'gif', 'ico', 'svg', 'eot', 'ttf', 'woff', 'woff2']

provide: ProvidePlugin config

type: {} default: {}

define: DefinePlugin config

type: {} default: {}

banner: BannerPlugin config

type: string default: empty string

alias: resolve-alias config

type: {} default: {}

flow: whether to use flow

type: bool default: false

flowRuntime: whether to use flow-runtime

type: bool default: false

minJs: whether minify js

type: bool default: true

minCss: whether minify css

type: bool default: true

devtool: devtool config

type: string

default:

  • cmd: start: eval-source-map
  • cmd: build: source-map

filename: library file name

type: string default: empty string

library: library exported global name, see output-library

type: string default: Index

externals: see externals

rules: extra webpack rules

type: [] default: []

plugins: extra webpack plugins

type: [] default: []

extra: extra webpack config options

type: {}/function default: {}

extra: { ... }
extra: webpack => ({ ... })

ext: entry script file extension, like js, jsx, vue

type: string default: js

- src/
  - index.${ext}

files of an entry

An entry has a standalone directory, also called workspace.

for build command

For build command, an entry has at least a index.js file.

If entry is not provided, @lila/index will be used as default.

If entry is @lila/index, its workspace is src:

- src/
  - index.js

  - other files and directories

Others(if entry is main), its workspace is src/main:

- src/
  - main/
    - index.js

    - other files and directories

for start command

For start command, an entry has at least a index.html file and a index.js file.

If entry is example, its workspace is example:

- src/
- example/
  - index.html
  - index.js

  - other files and directories

built-in rules

file extensions

  • .js: pure javascript code
  • .jsx: React component code
  • .vue: Vue component code