These are chat archives for ractivejs/ractive

19th
Aug 2018
kouts
@kouts
Aug 19 2018 19:47
I'm using latest Ractive with latest webpack (4.16.5) and I get Uncaught ReferenceError: require is not defined
I also tried Ractive 0.9 and I get the same
I've tried with super simple config
const webpack = require('webpack');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');

module.exports = {
    mode: 'development',
    target: 'web',
    context: path.resolve(__dirname, 'src'),
    plugins: [
        new CleanWebpackPlugin(['dist/js', 'dist/css'])
    ],    
    entry: {
        'main': './js/main.js'
    },
    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist/js'),
        publicPath: '/dist/js/'
    },
    module: {
        rules: [
        ]
    }
}
and in src/js/main.js just import Ractive from 'ractive';
any ideas?
kouts
@kouts
Aug 19 2018 20:02
other libraries such as jquery and moment.js load fine
seems like an incompatibility with latest webpack
Chris Reeves
@evs-chris
Aug 19 2018 21:05
that's really weird
can you tell if webpack is using the es module or the umd module?