Skip to content

Commit 9cfb110

Browse files
committed
Add dev server
1 parent 3a3a95d commit 9cfb110

7 files changed

+1144
-33
lines changed

package.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "vue-chrome-i18n",
33
"version": "1.0.0",
44
"description": "Vue plugin for chrome extension internationalization",
5-
"main": "index.js",
5+
"main": "./dist/vue-chrome-i18n.js",
6+
"module": "./dist/vue-chrome-i18n.js",
67
"repository": "https://github.com/Xvezda/vue-chrome-i18n",
78
"author": "Xvezda <[email protected]> (https://xvezda.com)",
89
"bugs": {
@@ -13,17 +14,22 @@
1314
"scripts": {
1415
"build": "cross-env NODE_ENV=production webpack",
1516
"clean": "rm -rf dist/",
16-
"check": "standard"
17+
"check": "standard",
18+
"dev": "concurrently \"webpack --watch\" \"webpack-dev-server\"",
19+
"serve": "webpack-dev-server",
20+
"prepublish": "yarn run clean && yarn run check && yarn run build"
1721
},
1822
"devDependencies": {
1923
"@babel/core": "^7.6.4",
2024
"babel-loader": "^8.0.6",
25+
"concurrently": "^5.1.0",
2126
"cross-env": "^6.0.3",
2227
"standard": "^14.3.1",
2328
"vue-loader": "^15.7.2",
2429
"vue-template-compiler": "^2.6.10",
2530
"webpack": "^4.41.2",
26-
"webpack-cli": "^3.3.10"
31+
"webpack-cli": "^3.3.10",
32+
"webpack-dev-server": "^3.10.3"
2733
},
2834
"resolutions": {
2935
"**/serialize-javascript": ">=2.1.1"

src/directive.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
1+
/**
2+
* Copyright (C) 2019 Xvezda <https://xvezda.com/>
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
28
import { replacer, pattern } from './utils'
39

410
export function bind (el, binding, vnode) {

src/filter.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/* Copyright (C) 2020 Xvezda <https://xvezda.com/> */
1+
/**
2+
* Copyright (C) 2019 Xvezda <https://xvezda.com/>
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
28
import { replacer } from './utils'
39

410
export function filter (value) {

src/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
1+
/**
2+
* Copyright (C) 2019 Xvezda <https://xvezda.com/>
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
28
import VueChromeI18n from './components/VueChromeI18n'
39
import { bind } from './directive'
410
import { filter } from './filter'

src/utils.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/* Copyright (C) 2019 Xvezda <https://xvezda.com/> */
1+
/**
2+
* Copyright (C) 2019 Xvezda <https://xvezda.com/>
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
28
export const pattern = /__MSG_([A-Za-z0-9_-]+)__/g
39

410
export function replacer (match, p1, offset, string) {

webpack.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@ module.exports = {
3333
},
3434
plugins: [
3535
new VueLoaderPlugin()
36-
]
36+
],
37+
devServer: {
38+
contentBase: path.resolve(__dirname),
39+
compress: true,
40+
port: 9000
41+
}
3742
}

0 commit comments

Comments
 (0)