Skip to content

Commit d8a4897

Browse files
Upgrade for rollup v0.48
1 parent 627b467 commit d8a4897

File tree

10 files changed

+116
-111
lines changed

10 files changed

+116
-111
lines changed

build/build.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

build/dev-server.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

config/bs-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
|
1313
|
1414
*/
15-
module.exports = {
15+
export default {
1616
"ui": false,
1717
"files": "test/index.html",
1818
"watchOptions": {},

config/rollup.config.js renamed to config/rollup.base.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
// Rollup plugins
2-
const buble = require('rollup-plugin-buble')
3-
const eslint = require('rollup-plugin-eslint')
4-
const resolve = require('rollup-plugin-node-resolve')
5-
const commonjs = require('rollup-plugin-commonjs')
6-
const uglify = require('rollup-plugin-uglify')
7-
const progress = require('rollup-plugin-progress')
2+
import buble from 'rollup-plugin-buble'
3+
import eslint from 'rollup-plugin-eslint'
4+
import resolve from 'rollup-plugin-node-resolve'
5+
import commonjs from 'rollup-plugin-commonjs'
6+
import uglify from 'rollup-plugin-uglify'
7+
import progress from 'rollup-plugin-progress'
88

9-
module.exports = {
10-
moduleName: 'parseEft',
11-
entry: 'src/eft-parser.js',
9+
export default {
10+
input: 'src/eft-parser.js',
11+
output: {
12+
name: 'parseEft',
13+
format: 'umd',
14+
sourcemap: true,
15+
},
1216
devDest: 'test/eft-parser.dev.js',
1317
proDest: 'dist/eft-parser.min.js',
14-
format: 'umd',
15-
sourceMap: 'inline',
1618
plugins: [
1719
progress({
1820
clearLine: false

config/rollup.build.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Set up environment
2+
import 'shelljs/global'
3+
if (env.BUILD_TARGET !== 'DEMO') env.NODE_ENV = 'production'
4+
5+
// Import base config
6+
import base from './rollup.base'
7+
8+
base.output.file = base.proDest
9+
base.output.sourcemap = env.BUILD_ENV === 'DEMO' || env.BUILD_ENV === 'CI' ? base.output.sourcemap : false
10+
11+
export default base

config/rollup.dev.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Import base config
2+
import base from './rollup.base'
3+
// Import browsersync config
4+
import bsConfig from './bs-config'
5+
// Import dev plugins
6+
import browsersync from 'rollup-plugin-browsersync'
7+
8+
base.output.file = base.devDest
9+
base.plugins.push(browsersync(bsConfig))
10+
base.watch = {
11+
chokidar: true,
12+
include: 'src/**'
13+
}
14+
15+
export default base

package-lock.json

Lines changed: 67 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "eft-parser",
3-
"version": "0.5.10",
3+
"version": "0.5.11",
44
"description": "ef.js template parser",
55
"main": "dist/eft-parser.min.js",
66
"module": "src/eft-parser.js",
77
"scripts": {
8-
"dev": "node ./build/dev-server.js",
9-
"build": "node ./build/build.js",
8+
"dev": "rollup -c ./config/rollup.dev.js -w",
9+
"build": "rollup -c ./config/rollup.build.js",
1010
"lint": "eslint --ext .js src"
1111
},
1212
"repository": {
@@ -26,10 +26,10 @@
2626
},
2727
"homepage": "https://github.com/ClassicOldSong/eft-parser#readme",
2828
"devDependencies": {
29-
"browser-sync": "^2.18.13",
30-
"eslint": "^4.4.1",
31-
"node-watch": "^0.5.5",
32-
"rollup": "^0.47.4",
29+
"chokidar": "^1.7.0",
30+
"eslint": "^4.5.0",
31+
"rollup": "^0.48.2",
32+
"rollup-plugin-browsersync": "^0.2.4",
3333
"rollup-plugin-buble": "^0.15.0",
3434
"rollup-plugin-commonjs": "^8.1.0",
3535
"rollup-plugin-eslint": "^4.0.0",

src/escape-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ const ESCAPE = (string) => {
7474
}
7575

7676
// export default ESCAPE
77-
module.exports = ESCAPE
77+
export default ESCAPE

test/eft-parser.dev.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)