Skip to content

heartAndRain/webpack-libify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-libify

Show Your Webpack Loader Transformed Source!

New Features

  • support ts and tsx files

约定

  • 使用到的 src 源码需要转化到 lib 中
  • src 中 require 的 id 不需要进行改变: abc.css -> abc.css.js, abc.jsx -> abc.jsx.js
  • ts 文件配合resolve.extensions直接引入, abc.ts -> abc.js
  • 所有 lib 中的模块 node 可运行

用法

// in your webpack.config.js
const libify = require.resolve('webpack-libify');

module.postLoaders: [ { loader: libify } ]

webpack_public_path

基于 require('js-tokens') 技术, 使用类 require("../webpack.config")[0].output.publicPath 替换掉 __webpack_public_path__

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%