2

RequireJS を使用したプロジェクトがあります。

私の app.build と require :

({
    appDir: './',
    baseUrl: "js",
    dir: "dist",
    mainConfigFile: "js/main.js",
    modules: [ { name: 'main' } ],
    optimizeCss: 'standard',
    removeCombined: true,
    preserveLicenseComments: false,
    optimize: "uglify",
    uglify: {
        max_line_length: 1000,
        compress: {
            cascade: true,
            drop_console: true,
            keep_fargs: true
        },
        defines: {
            DEBUG: ['name', 'false']
        },
        no_mangle: true
    },
    closure: {
        CompilerOptions: {},
        CompilationLevel: 'SIMPLE_OPTIMIZATIONS',
        loggingLevel: 'WARNING'
    }
})

コンパイル後、require.js、main.js、domReady.js の 3 つの js ファイルがあり、Almond 経由で単一のファイルを取得しようとして、いくつかのパラメーターを追加しました。

({
            appDir: './',
            baseUrl: "js",
            modules: [
                {
                    name: '../lib/almond/almond'
                },
                {
                    name: 'main'
                }
            ],
            include: ['main'],
            insertRequire: ['main'],
            wrap: true,
            dir: "dist",
            mainConfigFile: "js/main.js",
            optimizeCss: 'standard',
            removeCombined: true,
            preserveLicenseComments: false,
            optimize: "uglify",
            uglify: {
                ...
            },
            closure: {
                ...
            }
})

しかし、最終的にはまだ 3 つのファイルが残っています。よろしくお願いします。

4

1 に答える 1