diff --git a/config/webpack.dev.conf.js b/config/webpack.dev.conf.js new file mode 100644 index 0000000..80ac24b --- /dev/null +++ b/config/webpack.dev.conf.js @@ -0,0 +1,37 @@ +var webpack = require('webpack') + +module.exports = { + entry: 'mocha!./test/index.js', + output: { + path: './test', + filename: 'specs.js', + publicPath: '/' + }, + devtool: 'source-map', + module: { + loaders: [{ + test: /\.js$/, + exclude: /node_modules|vue\/dist/, + loader: 'babel', + query: { + presets: ['es2015'], + plugins: [ + 'babel-plugin-espower' + ] + } + }], + postLoaders: [{ + test: /\.json$/, + loader: 'json' + }] + }, + devServer: { + contentBase: './test', + port: 8081, + hot: true, + inline: true + }, + plugins: [ + new webpack.HotModuleReplacementPlugin() + ] +} diff --git a/package.json b/package.json index 6b5f62c..8c4df91 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "karma-sourcemap-loader": "^0.3.5", "karma-webpack": "^1.7.0", "mocha": "^2.3.4", + "mocha-loader": "^0.7.1", "phantomjs": "^1.9.18", "power-assert": "^1.2.0", "rollup": "^0.21.1", @@ -33,7 +34,8 @@ "rollup-plugin-replace": "^1.1.0", "uglify-js": "^2.6.1", "vue": "^1.0.10", - "webpack": "^1.12.9" + "webpack": "^1.12.9", + "webpack-dev-server": "^1.14.0" }, "files": [ "dist/vue-plugin-boilerplate.js", @@ -59,6 +61,7 @@ "scripts": { "build": "node config/build.js", "clean": "rm -rf coverage && rm -rf dist", + "dev": "webpack-dev-server --quiet --config config/webpack.dev.conf.js --host 0.0.0.0", "lint": "eslint src test config", "test": "karma start config/karma.conf.js", "watch": "webpack --watch --config config/webpack.conf.js" diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..994c04f --- /dev/null +++ b/test/index.html @@ -0,0 +1,10 @@ + + + + plugin tests + + + + + +