@@ -15,7 +15,6 @@ The build script:
1515var browserify = require (' browserify' )
1616var fs = require (' fs' )
1717
18- var to = __dirname + ' /static/bundle.js'
1918var b = browserify (__dirname + ' /src/entry.js' )
2019b .transform (require (' browserify-postcss' , {
2120 // a list of postcss plugins
@@ -24,13 +23,15 @@ b.transform(require('browserify-postcss', {
2423 ' postcss-advanced-variables' ,
2524 [' postcss-custom-url' , [
2625 [' inline' , { maxSize: 10 }],
27- [' copy' , { assetOutFolder: __dirname + ' /static/assets' }],
26+ [' copy' , {
27+ assetOutFolder: __dirname + ' /static/assets' ,
28+ baseUrl: ' assets' ,
29+ name: ' [name].[hash]' ,
30+ }],
2831 ]],
2932 ],
3033 // basedir where to search plugins
3134 basedir: __dirname + ' /src' ,
32- // options for processing.
33- postCssOptions: { to: to },
3435 // insert a style element to apply the styles
3536 inject: true ,
3637})
@@ -61,10 +62,15 @@ Default: `null`
6162Specify where to look for plugins.
6263
6364### postCssOptions
64- Specify the options for the [postcss] processor.
65+ Specify the [options](https://github.com/postcss/postcss/blob/master/docs/api.md#processorprocesscss-opts)
66+ for the [postcss] processor.
6567
6668The ` from` and ` to` fields will be set to the css file path by default.
6769
70+ The ` to` option is used to calculated ` url ()` in the final styles.
71+ However, if your [postcss] plugin does not need it,
72+ don't bother to specify.
73+
6874### inject
6975Specify how to use the styles:
7076
0 commit comments