mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
add oh-my-cdn & vendor script
This commit is contained in:
24
gruntfile.js
24
gruntfile.js
@@ -61,30 +61,6 @@ module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-electron-installer-debian')
|
||||
}
|
||||
|
||||
grunt.registerTask('copy', function () {
|
||||
var done = this.async()
|
||||
var targetPaths = [
|
||||
'node_modules/react/dist/react.min.js',
|
||||
'node_modules/react-dom/dist/react-dom.min.js',
|
||||
'node_modules/react-redux/dist/react-redux.min.js',
|
||||
'node_modules/redux/dist/redux.min.js'
|
||||
]
|
||||
|
||||
var merged = merge()
|
||||
targetPaths.forEach(function (targetPath) {
|
||||
var read = fs
|
||||
.createReadStream(path.resolve(__dirname, targetPath))
|
||||
var write = fs.createWriteStream(path.resolve(__dirname, 'compiled', path.basename(targetPath)))
|
||||
read.pipe(write)
|
||||
merged.add(read)
|
||||
})
|
||||
|
||||
merged
|
||||
.on('end', function () {
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
grunt.registerTask('compile', function () {
|
||||
var done = this.async()
|
||||
var execPath = path.join('node_modules', '.bin', 'webpack') + ' --config webpack-production.config.js'
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
<script src="../submodules/ace/src-min/ace.js"></script>
|
||||
<script src="../submodules/ace/src-min/ext-themelist.js"></script>
|
||||
<script src="../resources/katex.min.js"></script>
|
||||
<script src="../compiled/react.min.js"></script>
|
||||
<script src="../compiled/react-dom.min.js"></script>
|
||||
<script src="../compiled/redux.min.js"></script>
|
||||
<script src="../compiled/react-redux.min.js"></script>
|
||||
<script src="../compiled/react.js"></script>
|
||||
<script src="../compiled/react-dom.js"></script>
|
||||
<script src="../compiled/redux.js"></script>
|
||||
<script src="../compiled/react-redux.js"></script>
|
||||
<script type='text/javascript'>
|
||||
const electron = require('electron')
|
||||
electron.webFrame.setZoomLevelLimits(1, 1)
|
||||
|
||||
9
oh-my-cdn.json
Normal file
9
oh-my-cdn.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"directory": "compiled",
|
||||
"targets": {
|
||||
"react": "https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react.js",
|
||||
"react-dom": "https://cdnjs.cloudflare.com/ajax/libs/react/15.0.2/react-dom.js",
|
||||
"redux": "https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js",
|
||||
"react-redux": "https://npmcdn.com/react-redux@4.4.5/dist/react-redux.min.js"
|
||||
}
|
||||
}
|
||||
10
package.json
10
package.json
@@ -7,7 +7,8 @@
|
||||
"start": "electron ./index.js",
|
||||
"hot": "electron ./index.js --hot",
|
||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
||||
"postinstall": "grunt copy"
|
||||
"postinstall": "npm run vendor",
|
||||
"vendor": "oh-my-cdn"
|
||||
},
|
||||
"config": {
|
||||
"electron-version": "0.36.11"
|
||||
@@ -63,18 +64,15 @@
|
||||
"babel-preset-react-hmre": "^1.0.1",
|
||||
"css-loader": "^0.19.0",
|
||||
"electron-packager": "^6.0.0",
|
||||
"electron-prebuilt": "^0.36.11",
|
||||
"electron-prebuilt": "^0.36.12",
|
||||
"electron-release": "^2.2.0",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-electron-installer": "^1.2.0",
|
||||
"history": "^1.17.0",
|
||||
"merge-stream": "^1.0.0",
|
||||
"nib": "^1.1.0",
|
||||
"react": "^0.14.3",
|
||||
"oh-my-cdn": "^0.1.1",
|
||||
"react-css-modules": "^3.7.6",
|
||||
"react-dom": "^0.14.3",
|
||||
"react-redux": "^4.0.6",
|
||||
"redux": "^3.0.5",
|
||||
"standard": "^6.0.8",
|
||||
"style-loader": "^0.12.4",
|
||||
"stylus": "^0.52.4",
|
||||
|
||||
Reference in New Issue
Block a user