0

I'm currently using vue2-dropzone for a Rails 5 project. I've installed it with yarn add vue2-dropzone. The package includes its styles from the rollup.config.js file, as such:

export default {
  moduleName: 'vue2Dropzone',
  entry: 'src/index.js',
  dest: 'dist/vue2Dropzone.js',
  format: 'umd',
  sourceMap: true,
  plugins: [
    vue({
      compileTemplate: true,
      css: 'dist/vue2Dropzone.css' // Here we are :)
    }),
    ...
  ]
};

While this is displaying correctly for other users, Rails or Webpacker doesn't seem to pick those assets up (i.e. vue2Dropzone.css).

How does Rails/Webpacker load dependencies or static assets? Why wouldn't this file be loaded? Thanks in advance!

DaniG2k
  • 4,772
  • 36
  • 77

1 Answers1

1

You'll want to configure config/webpack.yml and include the path to the assets. See this. I've been creating separate packs for these types of components and then adding them to the erb's separately from application pack.

Todd Baur
  • 995
  • 8
  • 22