Skip to content

Commit

Permalink
Merge pull request #3714 from camptocamp/load_css_through_webpack
Browse files Browse the repository at this point in the history
Load CSS through webpack
  • Loading branch information
ger-benjamin committed Mar 28, 2018
2 parents 2a102c6 + 468d1e7 commit 0e3d88e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions buildtools/create-es6-package
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash
sed -i 's/"name": "ngeo",/"name": "ngeo-es6",/g' package.json
sed -i 'sY/ngeo\\/Y/ngeo-es6\\/Yg' buildtools/webpack.*.js
sed -i 'sY~openlayersY../../../node_modules/openlayersYg' contribs/gmf/less/base.less
sed -i 'sY~bootstrapY../../../node_modules/bootstrapYg' contribs/gmf/less/base.less
11 changes: 11 additions & 0 deletions docs/how_to_migrate_from_2.2_to_2.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ If you have no custom AngularJS element in your code, you may start directly wit

1. [Transform your components to modules](#transform-your-components-to-modules)
1. [Transform your applications to modules](#transform-your-applications-to-modules)
1. [Adapt paths for 'less'](#Adapt-paths-for-less)
1. [Test your application](#test-your-application)

### Transform your components to modules
Expand Down Expand Up @@ -292,6 +293,16 @@ these values to the module of your controller like this:
</script>
```

### Adapt paths for 'less'

You must import your `<interface.less>` in each application controller you have by something
like: `import '../../less/<interface>.less'`.

With Webpack (`less-loader`), to reference a file by it's relative URL, the beginning of the path must be the
current file. That means that, if in a file `a/b/c/d.js` you want to import the `.less` file located
in `a/x/y/z.less`, the import must be written like this: `import '../../x/y/z.less'`. Paths must also be
adapted for url in each `.less` file (for instance, for a `background-image: url("../../images/office.svg");`

### Test your application

Then your application should work. Test it and commit your changes.

0 comments on commit 0e3d88e

Please sign in to comment.