-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bae0ba
commit b7ca5b3
Showing
16 changed files
with
5,150 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
var path = require('path') | ||
|
||
exports.assetsPath = function (_path) { | ||
return path.posix.join('static', _path) | ||
} | ||
|
||
exports.cssLoaders = function (options) { | ||
options = options || {} | ||
|
||
var cssLoader = { | ||
loader: 'css-loader', | ||
options: { | ||
minimize: process.env.NODE_ENV === 'production', | ||
sourceMap: options.sourceMap | ||
} | ||
} | ||
|
||
// generate loader string to be used with extract text plugin | ||
function generateLoaders (loader, loaderOptions) { | ||
var loaders = [cssLoader] | ||
if (loader) { | ||
loaders.push({ | ||
loader: loader + '-loader', | ||
options: Object.assign({}, loaderOptions, { | ||
sourceMap: options.sourceMap | ||
}) | ||
}) | ||
} | ||
|
||
return ['vue-style-loader'].concat(loaders) | ||
} | ||
|
||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html | ||
return { | ||
css: generateLoaders(), | ||
scss: generateLoaders('sass'), | ||
} | ||
} | ||
|
||
// Generate loaders for standalone style files (outside of .vue) | ||
exports.styleLoaders = function (options) { | ||
var output = [] | ||
var loaders = exports.cssLoaders(options) | ||
for (var extension in loaders) { | ||
var loader = loaders[extension] | ||
output.push({ | ||
test: new RegExp('\\.' + extension + '$'), | ||
use: loader | ||
}) | ||
} | ||
return output | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var utils = require('./utils') | ||
|
||
module.exports = { | ||
loaders: utils.cssLoaders({ | ||
sourceMap: true, | ||
}), | ||
transformToRequire: { | ||
video: 'src', | ||
source: 'src', | ||
img: 'src', | ||
image: 'xlink:href' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
var path = require('path') | ||
var vueLoaderConfig = require('./vue-loader.conf') | ||
var webpack = require('webpack') | ||
|
||
function resolve(dir) { | ||
return path.join(__dirname, '..', dir) | ||
} | ||
|
||
module.exports = { | ||
devtool: '#inline-source-map', | ||
output: { | ||
path: resolve('dist'), | ||
filename: '[name].js', | ||
library: 'visibility', | ||
libraryTarget: 'umd' | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.vue', '.json'], | ||
alias: { | ||
'vue$': 'vue/dist/vue.esm.js', | ||
'@': resolve('src') | ||
} | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.(js|vue)$/, | ||
loader: 'eslint-loader', | ||
enforce: 'pre', | ||
include: [resolve('src'), resolve('test')], | ||
options: { | ||
formatter: require('eslint-friendly-formatter'), | ||
fix: true | ||
} | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader', | ||
options: vueLoaderConfig, | ||
|
||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
include: [resolve('src'), resolve('test')], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env': { NODE_ENV: '"testing"' } | ||
}) | ||
], | ||
node: { | ||
// prevent webpack from injecting useless setImmediate polyfill because Vue | ||
// source contains it (although only uses it if it's native). | ||
setImmediate: false, | ||
// prevent webpack from injecting mocks to Node native modules | ||
// that does not make sense for the client | ||
dgram: 'empty', | ||
fs: 'empty', | ||
net: 'empty', | ||
tls: 'empty', | ||
child_process: 'empty' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.