Browse Source

Add `grapesjs.version`

pull/330/head
Artur Arseniev 8 years ago
parent
commit
e5af4c6bc3
  1. 2
      index.html
  2. 1
      package.json
  3. 3
      src/grapesjs/index.js
  4. 7
      webpack.config.js
  5. 9
      yarn.lock

2
index.html

@ -1337,6 +1337,8 @@
});
editor.render();
console.log('version', grapesjs.version);
</script>
</body>
</html>

1
package.json

@ -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"
},

3
src/grapesjs/index.js

@ -9,6 +9,9 @@ module.exports = (() => {
return {
// Will be replaced on build
version: '<# VERSION #>',
editors,
plugins,

7
webpack.config.js

@ -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/,

9
yarn.lock

@ -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"
@ -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"

Loading…
Cancel
Save