diff options
author | Javan Makhmali <javan@javan.us> | 2018-02-06 12:09:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-06 12:09:08 -0500 |
commit | d57c52a385eb57c6ce8c6d124ab5e186f931d142 (patch) | |
tree | 45a58b0cdd69e5f9ab6cb2d3fe9692bda3f9bf7b | |
parent | f76c7e860e4d9306052b6a177902171890121648 (diff) | |
parent | c0368ad090b79c19300a4aa133bb188b2d9ab611 (diff) | |
download | rails-d57c52a385eb57c6ce8c6d124ab5e186f931d142.tar.gz rails-d57c52a385eb57c6ce8c6d124ab5e186f931d142.tar.bz2 rails-d57c52a385eb57c6ce8c6d124ab5e186f931d142.zip |
Merge pull request #31880 from rmacklin/publish-activestorage-source-in-addition-to-compiled-js
Include source code in published activestorage npm package
-rw-r--r-- | activestorage/.gitignore | 1 | ||||
-rw-r--r-- | activestorage/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activestorage/package.json | 10 |
3 files changed, 13 insertions, 3 deletions
diff --git a/activestorage/.gitignore b/activestorage/.gitignore index a532335bdd..29bdcc4468 100644 --- a/activestorage/.gitignore +++ b/activestorage/.gitignore @@ -1,5 +1,6 @@ .byebug_history node_modules +src test/dummy/db/*.sqlite3 test/dummy/db/*.sqlite3-journal test/dummy/log/*.log diff --git a/activestorage/CHANGELOG.md b/activestorage/CHANGELOG.md index 6354ab9924..682e35e0a8 100644 --- a/activestorage/CHANGELOG.md +++ b/activestorage/CHANGELOG.md @@ -1,3 +1,8 @@ +* Add source code to published npm package + This allows activestorage users to depend on the javascript source code + rather than the compiled code, which can produce smaller javascript bundles. + + *Richard Macklin* Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activestorage/CHANGELOG.md) for previous changes. diff --git a/activestorage/package.json b/activestorage/package.json index ec77dc391d..d23f8b179e 100644 --- a/activestorage/package.json +++ b/activestorage/package.json @@ -4,7 +4,8 @@ "description": "Attach cloud and local files in Rails applications", "main": "app/assets/javascripts/activestorage.js", "files": [ - "app/assets/javascripts/*.js" + "app/assets/javascripts/*.js", + "src/*.js" ], "homepage": "http://rubyonrails.org/", "repository": { @@ -16,18 +17,21 @@ }, "author": "Javan Makhmali <javan@javan.us>", "license": "MIT", + "dependencies": { + "spark-md5": "^3.0.0" + }, "devDependencies": { "babel-core": "^6.25.0", "babel-loader": "^7.1.1", "babel-preset-env": "^1.6.0", "eslint": "^4.3.0", "eslint-plugin-import": "^2.7.0", - "spark-md5": "^3.0.0", "webpack": "^3.4.0" }, "scripts": { "prebuild": "yarn lint", "build": "webpack -p", - "lint": "eslint app/javascript" + "lint": "eslint app/javascript", + "prepublishOnly": "rm -rf src && cp -R app/javascript/activestorage src" } } |