Skip to content

Commit

Permalink
Add grapesjs.version
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Sep 21, 2017
1 parent f6d8f10 commit e5af4c6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -1337,6 +1337,8 @@ <h1 class="heading">Insert title here</h1>
});

editor.render();

console.log('version', grapesjs.version);
</script>
</body>
</html>
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -37,6 +37,7 @@
"mocha": "^3.1.2",
"node-sass": "^4.5.3",
"sinon": "^3.2.1",
"string-replace-loader": "^1.3.0",
"webpack": "^3.5.5",
"webpack-dev-server": "^2.7.1"
},
Expand Down
3 changes: 3 additions & 0 deletions src/grapesjs/index.js
Expand Up @@ -9,6 +9,9 @@ module.exports = (() => {

return {

// Will be replaced on build
version: '<# VERSION #>',

editors,

plugins,
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Expand Up @@ -35,6 +35,13 @@ module.exports = {
plugins: plugins,
module: {
loaders: [{
test: /grapesjs\/index\.js$/,
loader: 'string-replace-loader',
query: {
search: '<# VERSION #>',
replace: pkg.version
}
},{
test: /\.js$/,
loader: 'babel-loader',
include: /src/,
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Expand Up @@ -3625,7 +3625,7 @@ lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"

lodash@^4.0.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4:
lodash@^4, lodash@^4.0.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

Expand Down Expand Up @@ -5393,6 +5393,13 @@ stream-shift@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952"

string-replace-loader@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string-replace-loader/-/string-replace-loader-1.3.0.tgz#1d404a7bf5e2ec21b08ffc76d89445fbe49bc01d"
dependencies:
loader-utils "^1.1.0"
lodash "^4"

string-template@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
Expand Down

0 comments on commit e5af4c6

Please sign in to comment.