ankurk91 / vue-trumbowyg

Vue.js component for Trumbowyg WYSIWYG editor :memo:
https://ankurk91.github.io/vue-trumbowyg/
MIT License
236 stars 35 forks source link

SVG imported as code and not file #23

Closed glimow closed 5 years ago

glimow commented 5 years ago

I'm submitting a ... (check one with "x")

[ ] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[X] Other, please describe

Tell about your platform

Current behavior When importing vue-trumbowyg, webpack imports the svg icons as code instead of svg. image Making the script to fail running in the browser. Expected behavior The SVG should be imported as a file and not be inserted into the code

My webpack config (extract):

{
        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
        use: {
          loader: 'url-loader',
          query: {
            limit: 10000,
            name: 'imgs/[name]--[folder].[ext]'
          }
        }
      },
      {
        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
        loader: 'url-loader',
        options: {
          limit: 10000,
          name: 'media/[name]--[folder].[ext]'
        }
      },
      {
        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
        use: {
          loader: 'url-loader',
          query: {
            limit: 10000,
            name: 'fonts/[name]--[folder].[ext]'
          }
        }
      }

I am using Webpack 3.5.2 with Electron-Vue setup

ankurk91 commented 5 years ago

I don't see any issue importing the *.svg icons, here is my config for webpack 4

https://github.com/ankurk91/vue-trumbowyg/blob/1058f9d3d34064e8170147fb0da7bb7cfbc92975/webpack.config.dev.js#L62-L68

Most likely webpack or loader issue.