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

@beisen/talent-ui-dll-webpack-config

v1.1.5

Published

## 说明

Downloads

8

Readme

talent-ui-dll-webpack-config

说明

用来协助生成talent-ui 2.0可以自动识别的dll的工具, 你可以自己配置DllPlugin来生成Dll, 但是talent-ui-dll-webpack-config集成了一套统一的逻辑和命名规则,可以让talent-ui-webpack-config自动识别出文件路径。并且可以自动根据生产或者开发环境自动选取对应文件。

输出的dll文件名称是通过读取dll项目的package.json中的name和version并交给 talent-ui-dll-naming-convention来自动生成。在talent-ui-webpack-config中也使用了这个naming-convention。所以通过talent-ui-dll-webpack-config生成的dll被自动识别出来。

通过talent-ui-dll-webpack-config生成的dll会同时输出生产环境和开发环境的dll, 开发环境的dll, 使用了NamedModulePlugin,而生成环境的dll没有使用NamedModulePlugin, 使用了UglifyJSPlugin来压缩输出代码。

应用

初始化项目:

    yarn init -y

安装talent-ui-dll-webpack-config

    yarn add @beisen/talent-ui-dll-webpack-config --dev
    

在你的应用项目下面创建webpack.config.js

    const dllWebpackConfig = require('@beisen/talent-ui-dll-webpack-config');
    const path = require('path');

    module.exports = dllWebpackConfig({
        root: path.resove(__dirname /**/) //这里统一为项目的根目录,方便使用统一的context,
        venders: require('./vender-list')
    })

创建vender-list.js

    module.exports = [
        'react',
        'react-dom',
        ...所有你想引进来的库
    ]

安装你需要打包的库

    yarn add react react-dom ....

执行打包:

    webpack -c webpack/webpack.config.js

查看输出文件,假如你package.json中的name是 qd-fed-dll, 版本号是1.0.0, 则输出的文件应该包含:

    //生产环境带版本号
    - qd-fed-dll-1.0.0.min.js
    - qd-fed-dll-1.0.0.manifest.json
    //开发环境不带版本号
    - qd-fed-dll.dev.js
    - qd-fed-dll.dev.manifest.json