mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Unminify activestorage.js
This commit is contained in:
parent
c81a7fcf76
commit
56fc1f812a
6 changed files with 1094 additions and 1387 deletions
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"presets": [
|
||||
["env", { "modules": false } ]
|
||||
],
|
||||
"plugins": [
|
||||
"external-helpers"
|
||||
]
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22,15 +22,19 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.25.0",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-external-helpers": "^6.22.0",
|
||||
"babel-preset-env": "^1.6.0",
|
||||
"eslint": "^4.3.0",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
"webpack": "^3.4.0"
|
||||
"rollup": "^0.58.2",
|
||||
"rollup-plugin-babel": "^3.0.4",
|
||||
"rollup-plugin-commonjs": "^9.1.0",
|
||||
"rollup-plugin-node-resolve": "^3.3.0",
|
||||
"rollup-plugin-uglify": "^3.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "yarn lint",
|
||||
"build": "webpack -p",
|
||||
"build": "rollup --config rollup.config.js",
|
||||
"lint": "eslint app/javascript",
|
||||
"prepublishOnly": "rm -rf src && cp -R app/javascript/activestorage src"
|
||||
}
|
||||
|
|
28
activestorage/rollup.config.js
Normal file
28
activestorage/rollup.config.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
import resolve from "rollup-plugin-node-resolve"
|
||||
import commonjs from "rollup-plugin-commonjs"
|
||||
import babel from "rollup-plugin-babel"
|
||||
import uglify from "rollup-plugin-uglify"
|
||||
|
||||
const uglifyOptions = {
|
||||
mangle: false,
|
||||
compress: false,
|
||||
output: {
|
||||
beautify: true,
|
||||
indent_level: 2
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
input: "app/javascript/activestorage/index.js",
|
||||
output: {
|
||||
file: "app/assets/javascripts/activestorage.js",
|
||||
format: "umd",
|
||||
name: "ActiveStorage"
|
||||
},
|
||||
plugins: [
|
||||
resolve(),
|
||||
commonjs(),
|
||||
babel(),
|
||||
uglify(uglifyOptions)
|
||||
]
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
const path = require("path")
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
"activestorage": path.resolve(__dirname, "app/javascript/activestorage/index.js"),
|
||||
},
|
||||
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: path.resolve(__dirname, "app/assets/javascripts"),
|
||||
library: "ActiveStorage",
|
||||
libraryTarget: "umd"
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: "babel-loader"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue