google-closure-deps-webpack-plugin
This plugin not support anymore, all functionality has combine to google-closure-library-webpack-plugin!!
Webpack plugin for generating Google Closure deps, work with google-closure-library-webpack-plugin.
Note: donnot use Google Closure in babel js file(end with jsx
)!! But if you stick it, just replace the regex with r'^.+\.jsx?$'
, this code is under <your project>/node_modules/google-closure-library/closure/bin/build/treescan.py
:
# Matches a .js file path._JS_FILE_REGEX = re.compile(r'^.+\.js$')
usage
Case these files in your project are written with Google Closure:
// <your project>/src/hello.jsgoog;goog; var ele = googdom; ;
// <your project>/src/index.js; documentbody;
Config webpack with:
const GCLibraryPlugin = ;const GCDepsPlugin = ; moduleexports = // ... plugins: output: '.tmp/deps.js' source: roots: 'src' goog: 'node_modules/google-closure-library/closure/goog/base.js' python: 'python' closureLibraryBase: require deps: require // path for generated depenencies file. '.tmp/deps.js'
example
- template-closure-webpack-plugin-2
Use pluginsgoogle-closure-deps-webpack-plugin
andgoogle-closure-library-webpack-plugin
support Closure Library in webpack.
options
- output
Full path for Closure deps.js file - source
- roos
Directories list for search dependencies - jsPaths
JavaScript sources files for search dependencies - excludes
Excludes files list
- roos
- goog
Path to Closure Library bootstrap file base.js - python
"python3", "/usr/bin/python3" or something
More visit https://developers.google.com/closure/library.