Browserify и Babel Grunt Issue - PullRequest
       97

Browserify и Babel Grunt Issue

0 голосов
/ 08 ноября 2019

У меня странная проблема при использовании browserify и babel в хрюканье. Все отлично работает в сгенерированном коде для компьютеров Mac и Windows, но некоторые из машин Windows имеют проблемы в сгенерированном коде, и в браузере появляется ошибка: модуль не найден.

_prelude.js:1 Uncaught Error: Cannot find module './<module-name>'
    at o (_prelude.js:1)
    at _prelude.js:1
    at Object.5.././<module-name> source-file.js:1)
    at o (_prelude.js:1)
    at r (_prelude.js:1)
    at _prelude.js:1

grunt Задача:

browserify: {
    dist: {
        files: {
                'desktop/common/js/src/js-compiled/script-generated.js': [
                'desktop/common/js/src/source-file1.js',
                'desktop/common/js/src/source-file2.js',
                'desktop/common/js/src/source-file3.js',
            ]
        },
        options: {
            transform: [
                ['babelify', {
                    presets: "es2015"
                }]
            ],
            browserifyOptions: {
                debug: true
            }
        }
    }
},

Пакет JSON:

"@babel/core": "^7.6.2",
    "babel-cli": "^6.26.0",
    "babel-polyfill": "^6.26.0",
    "babel-preset-es2015": "^6.24.1",
    "babelify": "7.2.0 ",
    "grunt": "~0.4.2",
    "grunt-browserify": "^5.3.0",
...