webpack build less files output one css minify file

后端 未结 1 1453
离开以前
离开以前 2021-02-15 11:19

Is webpack the tool that I need to pass several less files into one minified CSS file?
if so, I\'m not sure what I\'m doing wrong in the code below?
Is there a way of ou

1条回答
  •  梦如初夏
    2021-02-15 12:06

    You're almost there. Like you already did, you can get all your styling into one css file using ExtractTextPlugin. To put your js and css into a different directories, you can just define a path in ExtractTextPlugin or output.filename that is relative to your output.path. For example:

    output: {
        path: './assets',
        filename: './javascripts/bundle/[name].js'
    },
    plugins: [
        new ExtractTextPlugin("./stylesheets/bundle/[name].css")
    ]
    

    0 讨论(0)
提交回复
热议问题