Skip to content

Combine Vanilla JS #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IndraGunawan opened this issue Aug 30, 2017 · 9 comments
Closed

Combine Vanilla JS #149

IndraGunawan opened this issue Aug 30, 2017 · 9 comments

Comments

@IndraGunawan
Copy link

is there a way to combining vanilla js?

something like https://laravel.com/docs/5.4/mix#vanilla-js

@stof
Copy link
Member

stof commented Aug 30, 2017

Nope. webpack-encore is a builder for webpack configuration object. It does not implement any processing on its own.
There is no plan to change this. If you just want to concatenate files together, use a different tool for that (it could be gulp with gulp-concat for instance)

@Lyrkan
Copy link
Collaborator

Lyrkan commented Aug 30, 2017

I've seen someone talk about this Webpack plugin in another issue (I think it was #136 but the response has been deleted since then).

Never used it myself but based on its description it could fit your needs:

const ConcatPlugin = require('webpack-concat-plugin');

Encore.addPlugin(new ConcatPlugin({
    fileName: 'output.js',
    filesToConcat: [
        './file1.js',
        './file2.js'
    ]
}))

@IndraGunawan
Copy link
Author

IndraGunawan commented Aug 31, 2017

@stof thanks for the information.

@Lyrkan thanks. i have already test that webpack plugin, then the problem is when i concat with hash file name, the filename does not include in manifest.json that created by encore.

i think its good if encore can create something like dispatch an event when creating the manifest.json so another plugin can listen that event. cc: @weaverryan
ps: i am new in js, i don't know it can be implement or not.

@Lyrkan
Copy link
Collaborator

Lyrkan commented Aug 31, 2017

There is actually another issue about that (it didn't show up when searching for "concat"): #140

Looks like it could be solved after some changes in the Webpack Manifest Plugin.

@SvetlinStaev
Copy link

Hi, I am running into a similar problem with the concat js file not available in the manifest, I see that the issuer has been closed in the Webpack Manifest Plugin, but the file is still not injectable in the manifest.json, is there any additional configuration necessary in Encore to do that?

@stof
Copy link
Member

stof commented Sep 13, 2017

@weaverryan could it be that custom plugins are added after the manifest plugin (and so files they inject are not known by the manifest plugin) ?

@Lyrkan
Copy link
Collaborator

Lyrkan commented Sep 13, 2017

@stof That's probably needed but this PR hasn't been released yet anyway (merged 3 days ago).

@weaverryan
Copy link
Member

There are 2 things going on here:

  1. That PR (Copy plugin integration shellscape/webpack-manifest-plugin#75) was merged into master. There are a few breaking changes that are on master... waiting for a v2 release. So, we're waiting on that.

  2. We don't actually use https://github.com/danethurber/webpack-manifest-plugin :). We have a copy of it hardcoded into our repo. There were 2 issues (I believe both fixed on master, so in v2) that are well-commented in our version of the file that caused this.

tl;dr When v2 of that library is released, we should be able to start using it again (woo!) and then this issue will be closed.

@weaverryan
Copy link
Member

Closing. We now use the official webpack-manifest-plugin lib, and you can configure it via Encore. configureManifestPlugin().

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants