https://cypress.io logo
[react - webpack] webpack.config.js in another dir...
# i-need-help
c
I get Module not found: Error: Can't resolve 'sdk/theme/themes/[projectName]/src/js/cypress/support/component-index.html' because i have cypress located at sdk/tests/[projectName]/. How can i fix this problem without changing my project structure? for better understanding, my project structure is attached and content of my webpack.config file is:
Copy code
js
const path = require('path');
const srcPath = path.resolve(__dirname + '/src/js')

module.exports = {
    context: srcPath,
    mode: 'production',
    watch: false,
    entry: {
        main: srcPath + '/styleguide/index.js'
    },
    output: {
        filename: 'styleguide-webpack.js'
    },
    devtool: 'cheap-module-eval-source-map',
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
            }
        ]
    },
    plugins: []
Hope anyone can help
5 Views