-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-webpack.sh
More file actions
executable file
·37 lines (30 loc) · 1.05 KB
/
Copy pathtest-webpack.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
npm install
npm install webpack
# for backbone
npm install jquery
./node_modules/.bin/webpack './index' --output-file /dev/null
#./node_modules/.bin/webpack './index' --output-file /dev/null --display-chunks --display-modules --display-reasons
npm install mocha-loader
npm install mocha-phantomjs
npm install phantomjs-polyfill
# for fs mock
npm install raw-loader
cat << EOF > webpack-test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/></head>
<body>
<!--https://github.com/webpack/style-loader/issues/31-->
<script type="text/javascript" charset="utf-8" src="node_modules/phantomjs-polyfill/bind-polyfill.js"></script>
<script type="text/javascript" charset="utf-8" src="webpack-test.bundle.js"></script>
</body>
</html>
EOF
cat << EOF > webpack-test.js
var requireTest = require.context('./test/', true, /Spec\.js$/);
requireTest.keys().forEach(requireTest);
EOF
./node_modules/.bin/webpack 'mocha\!./webpack-test.js' --output-file webpack-test.bundle.js --resolve-alias fs=./fs-webpack-mock
./node_modules/.bin/mocha-phantomjs webpack-test.html