Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't resolve './https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin' #3763

Closed
yanwii opened this issue Aug 28, 2019 · 2 comments
Labels

Comments

@yanwii
Copy link

yanwii commented Aug 28, 2019

The error

ERROR in ./node_modules/semantic-ui-css/semantic.min.css (./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js??ref--5-2!./node_modules/semantic-ui-css/semantic.min.css)
Module build failed (from ./node_modules/less-loader/dist/cjs.js):


 */
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin);/*!
^
Can't resolve './https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin' in '\frontend\node_modules\semantic-ui-css'
      in \frontend\node_modules\semantic-ui-css\semantic.min.css (line 11, column 0)
 @ ./node_modules/semantic-ui-css/semantic.min.css 1:14-108
 @ ./src/App.js
 @ ./src/index.js

Webpack.config.js

var webpack = require('webpack');
const path = require('path');
module.exports = {
    resolve:{
        alias: {
            '@': `${__dirname}/src/`,
            'routes': `${__dirname}/src/routes/`,
            'layouts': `${__dirname}/src/layouts/`,
            'components': `${__dirname}/src/components/`,
            'containers': `${__dirname}/src/containers/`,
            "store": `${__dirname}/src/store/`
        }
    },
    entry: {
        bundle: "./src/index.js"
    },
    optimization: {
        splitChunks: {
            automaticNameDelimiter: "~",
            cacheGroups: {
                default: {
                    minChunks: 2,
                    priority: -20,
                    reuseExistingChunk: true,
                },
                vendor: {
                    chunks: "all",
                    test: /[\\/]node_modules[\\/]/,
                    priority: -10,
                    name: "vendor",
                    minSize: 0,
                    filename: '[name].bundle.js'
                }
            }
        },
    },
    output: {
        path: path.resolve(__dirname, '../backend/static/js'),
        filename: "bundle.js",
        publicPath:'/'
    },
    devServer: {
        historyApiFallback: true
    },
    module: {
        rules: [
            {
                test: /\.jsx?$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
            },
            {
                test: /\.less$|\.css$/,
                use:[{
                    loader: "style-loader"
                }, {
                    loader: "css-loader",
                }, {
                    loader: "less-loader",
                    options: {
                        javascriptEnabled: true
                    }
                }],
                include: [
                    path.join(__dirname, 'src'),
                    /node_modules/
                  ],
                
            },
            {
                test: /\.(png|jpg|woff|svg)$/,
                loader: 'url-loader?limit=8192'
            },
            {
                test: /\.(png|jpg|woff|svg)$/,
                loader: 'file-loader'
            },
        ]
    },
};
@welcome
Copy link

welcome bot commented Aug 28, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@layershifter
Copy link
Member

            {
                test: /\.less$|\.css$/, // <== Looks that this thing is wrong
            },

As semantic-ui-css provides only CSS you need to handle .css separately without less-loader, webpack-contrib/less-loader#67.

Please, consider to use StackOveflow for questions about Webpack configs, we use Github issues to handle library-related issues and bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants