zinserjan/mocha-webpack

What am i doing wrong?

Opened this issue · 0 comments

This is probably someting really simple

I have a simple webpack + ts setup.

my webpack.config-test.js looks thusly

var nodeExternals = require('webpack-node-externals');

console.log(__dirname);

module.exports = {
    target: 'node', // webpack should compile node compatible code
    externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
    module: {
        rules: [
            {
                test: /\.ts?$/,
                use: 'babel-loader',
                exclude: /node_modules/
            },
        ]
    }
};

However when I run my test, I have the first line to import the module I want to test
import User from '../../src/models/User';

but it cannot find the module, the path is 100% correct, what am I doing wrong?

Help me obi wan kenobi.......