小编Jag*_*ngh的帖子

Symfony Webpack Encore,将多个JS / CSS文件转换为一个文件

我想从多个css / js文件创建一个css / js文件。多个addEntry无法正常工作,请检查我的代码并提供解决方案。

var Encore = require('@symfony/webpack-encore');

Encore
        // the project directory where compiled assets will be stored
        .setOutputPath('web/build/')
        // the public path used by the web server to access the previous directory
        .setPublicPath('/build')
        .cleanupOutputBeforeBuild()
        .enableSourceMaps(!Encore.isProduction())
        // uncomment to create hashed filenames (e.g. app.abc123.css)
        .enableVersioning(Encore.isProduction())
        // uncomment for legacy applications that require $/jQuery as a global variable
        //.autoProvidejQuery()
        // uncomment to define the assets of the project
        .addEntry('js/app', './assets/js/app.js')
        .addEntry('js/uploader', './assets/js/uploader.js')
        .addStyleEntry('css/icons', './assets/css/icons.scss')
        .addStyleEntry('css/app', './assets/css/app.scss')
        .addStyleEntry('css/uploader', './assets/css/uploader.scss')

        // …
Run Code Online (Sandbox Code Playgroud)

symfony webpack-encore

5
推荐指数
2
解决办法
3522
查看次数

标签 统计

symfony ×1

webpack-encore ×1