Skip to content
Snippets Groups Projects

[FEATURE] remove static JS includes and rewrite all JS to ES6 modules

Merged Philipp Nowinski requested to merge feature_rewriteJs into master
1 file
+ 27
0
Compare changes
  • Side-by-side
  • Inline
Upgrade.md 0 → 100644
+ 27
0
# Upgrade from ```6.x.x``` to ```7.x.x```
In Version 7, we rewrote all included JavaScript to ES6 modules. This means that they won't be included in your site automatically when you install the extension.
## Importing the sgnews bundle in your main project
sg_news offers a front-package that imports all sub modules and initilaizes them correctly. You can import this in your bundle like that:
```js
import SgNews from 'sgnews';
new SgNews();
```
### Mapping ```sgnews``` to the extension JavaScript
In order for your module bundler to find the ```sgnews``` package, you need to add the path to your configuration. If you are using the SGC, you can add the following to your ```.sgc-config.json```
```js
{
"js": {
"libraryPaths": [
...
"./web/typo3conf/ext/sg_news/Resources/Public/JavaScript/"
]
}
}
```
Loading