webpack-contrib / expose-loader

Expose Loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with alias while exposing private module

kongaraju opened this issue · comments

I have a simple webpack config

module.exports = {
    mode: 'production',
    target: ["web", "es5"],
    context: path.resolve(__dirname, 'app'),
    entry,
    output,
    resolve: {
        modules: [
            path.resolve(__dirname, "app"),
            path.resolve(__dirname, "libs")],
        alias:{
            'mylib': './libs/mylib-1.1.js'
        }
    },
    module:{
        rules:[
             {
                test: require.resolve('mylib'),
                loader: 'expose-loader',
                resolve: {
                    alias
                },
                options: {
                    exposes: ['MyFunc'],
                },
            },
        ]
        
    }
}

webpack could not able to resolve mylib, throwing error package not found.

am I missing something? please help me to resolve the issue.

Thank you for creating this issue. However, issues need to follow one of our templates so that we can clearly understand your particular circumstances.

Please help us help you by recreating the issue using one of our templates.

Please respect time of other developers. I will reopen this after you fix the problem with the issue template