提交 76c9a7ad 编写于 作者: J Javan Makhmali

Merge pull request #32721 from javan/ast-unminify-js

Unminify activestorage.js
# Conflicts:
#	activestorage/app/assets/javascripts/activestorage.js
上级 287b24f9
{
"presets": [
["env", { "modules": false } ]
],
"plugins": [
"external-helpers"
]
}
......@@ -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"
}
......
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)
]
}
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"
}
}
]
}
}
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册