gadyonysh / semantic-ui-less-module-loader

Webpack loader for semantic-ui-less modules
MIT License
17 stars 2 forks source link

Font Path Issue #4

Closed brianjd closed 7 years ago

brianjd commented 7 years ago

I'm currently receiving the following error:

ERROR in ./~/css-loader?{}!./~/semantic-ui-less-module-loader?{"sourceMap":true,"themeConfigPath":"/Users/username/project/src/assets/less/theme.config","themesFolder":"/Users/username/project/~/semantic-ui-less/themes"}!./~/semantic-ui-less/semantic.less
    Module not found: Error: Can't resolve './themes/themes/default/assets/fonts/icons.eot' in '/Users/username/project/node_modules/semantic-ui-less'
     @ ./~/css-loader?{}!./~/semantic-ui-less-module-loader?{"sourceMap":true,"themeConfigPath":"/Users/username/project/src/assets/less/theme.config","themesFolder":"/Users/username/project/~/semantic-ui-less/themes"}!./~/semantic-ui-less/semantic.less

As you can see, the resolved font path of ./themes/themes/default/assets/fonts/icons.eot is incorrect, it is being prefixed with an additional 'themes'. Here is my webpack module configuration:

        {
          test: /\.js(|x)$/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
            options: {
              cacheDirectory: true,
              presets: [['es2015', { modules: false }], 'react', 'stage-0']
            }
          }
        }, {
          test: /\.jsx?$/,
          use: ['semantic-ui-react-less-loader'],
          include: [/node_modules[\/\\]semantic-ui-react/]
        }, {
          test: /\.(woff|woff2|ttf|svg|eot)$/,
          loader: 'url-loader?limit=10240&name=fonts/[name]-[hash:7].[ext]',
          include: [/fonts/, /[\/\\]node_modules[\/\\]semantic-ui-less[\/\\]/]
         }, {
          test: /\.(jpe?g|png|gif|svg)$/,
          use: [
            {
              loader: 'url-loader',
              options: { limit: 40000 }
            },
            'image-webpack-loader'
          ]
        }, {
          test: /\.css$/,
          loader: ExtractTextPlugin.extract({
            use: 'css-loader'
          })
        }, {
          test: /\.less$/,
          include: /[\/\\]node_modules[\/\\]semantic-ui-less[\/\\]/,
          use: ExtractTextPlugin.extract({
            use: [{
                loader: 'css-loader',
                options: {
                  importLoaders: 1,
                  minimize: true
                }
              }, {
                loader: 'semantic-ui-less-module-loader',
                options: {
                  sourceMap: true,
                  themeConfigPath: resolve(__dirname, './src/assets/less/theme.config'),
                  // Specifying this doesn't fix, with or without themes at the end
                  // themesFolder: resolve(__dirname, './node_modules/semantic-ui-less/themes')
                }
              }
            ]
          })
        },

My theme.config is currently default.

Please advise.

brianjd commented 7 years ago

Just noticed the issue noted at the bottom of README. I will investigate that thread. Closing for now.