Skip to content
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

Config with no entry but only vendor bundles does not output vendor bundle. #147

Open
mesozoic-technology opened this issue Apr 6, 2017 · 1 comment

Comments

@mesozoic-technology
Copy link

mesozoic-technology commented Apr 6, 2017

I have a config that doesn't have an entrypoint for the app, rather just an array of entry points that are dependencies which it should output in a vendor bundle. According to the task it is emitting this file. But when it is complete, I don't see the file anywhere in my filesystem.

This is what shows in my console after running the task:

[16:12:22] Starting 'dependencies-webpack'...
[16:12:40] Version: webpack 2.3.3
Child
              Asset     Size  Chunks                    Chunk Names
    app.min.js  1.06 MB       0  [emitted]  [big]     app
    manifest.min.js  1.37 kB       1  [emitted]         manifest
[16:12:40] Finished 'dependencies-webpack' after 18 s

This is my webpack config:

module.exports = [
  {
    entry: {
      app: [
        'fastclick',
        'lodash',
        'js-cookie',
        'moment',
        'jquery',
        'jquery-validation',
        'eonasdan-bootstrap-datetimepicker',
        'leaflet',
        'medium-editor',
        'script-loader!' + __dirname + '/src/scripts/tracking/tracking.js',
        'script-loader!' + __dirname + '/src/scripts/globals/global.js',
        'script-loader!' + __dirname + '/src/scripts/globals/flash.js',
        'script-loader!' + __dirname + '/src/scripts/globals/referrals.js',
        'bootstrap-loader/lib/bootstrap.loader?&configFilePath=' + __dirname + '/.bootstraprc!bootstrap-loader/no-op.js',
        'expose-loader?PruneClusterForLeaflet!' + __dirname + '/node_modules/PruneCluster/dist/PruneCluster.js',
      ],
    },
    output: {
      filename: '[name].min.js',
      path: path.resolve(__dirname, './public/')
    },
    plugins:[
      new webpack.optimize.CommonsChunkPlugin({
        names: ['numundo', 'manifest']
      }),
      new UglifyJSPlugin()
    ],
    module: {
      rules: [
        {
          test: require.resolve('lodash'),
          use: [{
            loader: 'expose-loader',
            options: '_'
          }]
        },
        { test: require.resolve('moment'),
          use: [{
            loader: 'expose-loader',
            options: 'moment'
          }]
        },
        { test: require.resolve('js-cookie'),
          use: [{
            loader: 'expose-loader',
            options: 'Cookies'
          }]
        },
        { test: require.resolve('leaflet'),
          use: [{
            loader: 'expose-loader',
            options: 'L'
          }]
        },
        { test: require.resolve('jquery'),
          use: [{
            loader: 'expose-loader',
            options: 'jQuery'
          }, {
            loader: 'expose-loader',
            options: '$'
          }]
        },
        { test: require.resolve('jquery-validation'), use: 'imports-loader?$=jquery' },
        { test: require.resolve('eonasdan-bootstrap-datetimepicker'), use: 'imports-loader?$=jquery'},
        { test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery' },
      ],
    },
  }
];
@bmurr
Copy link

bmurr commented Apr 7, 2017

Just a guess, but maybe your files are getting written to memory by webpack and webpack-stream is never picking them up?

I'm having a similar issue at the moment, where webpack will write to disk, but webpack-stream changes webpack to use a MemoryFileSystem on this line.
Plugins that call compiler.outputFileSystem.writeFile then write to memory rather than to disk.

So maybe log out the filesystem object in the after-emit function and see if your files are in there?

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

2 participants