`Stylus resolve url when building Webpack?
R
R
retyui2016-12-02 17:44:11
webpack
retyui, 2016-12-02 17:44:11

Stylus resolve url when building Webpack?

Config, as you can see &resolve url option is enabled to fix file paths,

{
            test: /\.styl$/,
            loader: ExtractTextPlugin.extract(
                `style-loader`,
                `css-loader?sourceMap!postcss-loader!stylus-loader?paths[]=node_modules,paths[]=lib&include css&resolve url`,
                {publicPath: ``}
            )
        }

Just not for fill !
Child extract-text-webpack-plugin:
        + 1 hidden modules

    ERROR in ./~/css-loader?sourceMap!./~/postcss-loader!./~/stylus-loader?paths[]=node_modules,paths[]=lib&include css&resolve url!./src/css/theme.styl
    Module build failed: TypeError: G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\src\css\components\ps_socialfollow.styl:35:22
       31|              &--vimeo:hover
       32|                      color #69b4e5
       33|              &--instagram:hover
       34|                      .__i0
       35|                              fill url('#__gr1')
    ----------------------------^
       36|              //      .__i1
       37|              //              fill url('#__gr2')
       38|              //      .__i2

    Path must be a string. Received null
        at ".__i0" (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\src\css\components\ps_socialfollow.styl:34:21)
        at "&--instagram:hover" (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\src\css\components\ps_socialfollow.styl:33:17)
        at "&__link" (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\src\css\components\ps_socialfollow.styl:10:23)
        at ".c-social" (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\src\css\components\ps_socialfollow.styl:56:13)

        at assertPath (path.js:7:11)
        at Object.isAbsolute [as absolute] (path.js:439:5)
        at Object.exports.lookup (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\node_modules\stylus\lib\utils.js:50:15)
        at resolveComponent (G:\web\xamp\htdocs\ps\themes\belvg_zerro\_dev\node_modules\stylus-loader\lib\resolver.js:87:25)
        at Array.map (native)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question