Load customized vendor script through script-loader

This commit is contained in:
Yukai Huang 2016-10-12 13:18:29 +08:00
parent 2e929879ad
commit 02eef3f68a
3 changed files with 15 additions and 5 deletions

View file

@ -131,6 +131,7 @@
"json-loader": "^0.5.4",
"less": "^2.7.1",
"less-loader": "^2.2.3",
"script-loader": "^0.7.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.2"

View file

@ -23,11 +23,7 @@
<script src="<%- url %>/vendor/Idle.Js/build/idle.min.js" defer></script>
<script src="<%- url %>/build/vendor.js" defer></script>
<!--codemirror-->
<script src="<%- url %>/vendor/codemirror/codemirror.min.js" defer></script>
<script src="<%- url %>/vendor/inlineAttachment/inline-attachment.js" defer></script>
<script src="<%- url %>/vendor/inlineAttachment/codemirror.inline-attachment.js" defer></script>
<script src="<%- url %>/vendor/codemirror-spell-checker/spell-checker.min.js" defer></script>
<script src="<%- url %>/vendor/ot/ot.min.js" defer></script>
<script src="<%- url %>/build/index.js" defer></script>
<script src="<%- url %>/js/google-drive-upload.js" defer></script>
<script src="<%- url %>/js/google-drive-picker.js" defer></script>

View file

@ -39,7 +39,11 @@ module.exports = {
"expose?filterXSS!xss",
"js-url",
"bootstrap",
"expose?ListPagination!list.pagination.js/dist/list.pagination.js"
"expose?ListPagination!list.pagination.js/dist/list.pagination.js",
path.join(__dirname, 'public/vendor/codemirror/codemirror.min.js'),
path.join(__dirname, 'public/vendor/inlineAttachment/inline-attachment.js'),
path.join(__dirname, 'public/vendor/inlineAttachment/codemirror.inline-attachment.js'),
path.join(__dirname, 'public/vendor/ot/ot.min.js')
]
},
@ -85,6 +89,15 @@ module.exports = {
}, {
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=image/svg+xml"
}, {
test: /\.js/,
loader: "script-loader",
include: [
path.join(__dirname, 'public/vendor/codemirror/codemirror.min.js'),
path.join(__dirname, 'public/vendor/inlineAttachment/inline-attachment.js'),
path.join(__dirname, 'public/vendor/inlineAttachment/codemirror.inline-attachment.js'),
path.join(__dirname, 'public/vendor/ot/ot.min.js')
]
}]
},