Skip to content

Commit

Permalink
Merge pull request #1422 from ckeditor/t/1420
Browse files Browse the repository at this point in the history
Internal: Updated the `raw-loader` dependency to 1.0.0. Updated the Vue.js component guide. Closes #1420.
  • Loading branch information
oleq authored Dec 19, 2018
2 parents 2aaa60d + e24e959 commit 72d9466
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 23 additions & 3 deletions docs/builds/guides/frameworks/vuejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ npm install --save \
@ckeditor/ckeditor5-dev-webpack-plugin \
@ckeditor/ckeditor5-dev-utils \
postcss-loader \
raw-loader@0.5.1
raw-loader
```

Edit the `vue.config.js` file and use the following configuration. If the file is not present, create it in the root of the application (i.e. next to `package.json`):
Expand Down Expand Up @@ -236,10 +236,30 @@ module.exports = {
chainWebpack: config => {
// Vue CLI would normally use its own loader to load .svg files. The icons used by
// CKEditor should be loaded using raw-loader instead.

// Get the default rule for *.svg files.
const svgRule = config.module.rule( 'svg' );

// Then you can either:
//
// * clear all loaders for existing 'svg' rule:
//
// svgRule.uses.clear();
//
// * or exclude ckeditor directory from node_modules:
svgRule.exclude.add( __dirname + '/node_modules/@ckeditor' );

// Add an entry for *.svg files belonging to CKEditor. You can either:
//
// * modify the existing 'svg' rule:
//
// svgRule.use( 'raw-loader' ).loader( 'raw-loader' );
//
// * or add a new one:
config.module
.rule( 'svg' )
.rule( 'cke-svg' )
.test( /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/ )
.use( 'file-loader' )
.use( 'raw-loader' )
.loader( 'raw-loader' );
}
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"mini-css-extract-plugin": "^0.4.0",
"minimatch": "^3.0.4",
"postcss-loader": "^3.0.0",
"raw-loader": "^0.5.1",
"raw-loader": "^1.0.0",
"style-loader": "^0.23.0",
"svgo": "^1.1.0",
"uglifyjs-webpack-plugin": "^1.2.7",
Expand Down

0 comments on commit 72d9466

Please sign in to comment.