-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit 4fe5fa9
Showing
12 changed files
with
7,673 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
presets: ['@babel/preset-env'], | ||
plugins: [ | ||
'@babel/plugin-transform-runtime', | ||
'@babel/plugin-proposal-export-default-from', | ||
], | ||
}; |
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,23 @@ | ||
# Editor configuration normalization | ||
# @see http://editorconfig.org/ | ||
|
||
# This is the top-most .editorconfig file; do not search in parent directories. | ||
root = true | ||
|
||
# All files. | ||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
# Yep, we need those special characters. | ||
charset = utf-8 | ||
# Delete unnecessary whitespaces at end of lines | ||
trim_trailing_whitespace = true | ||
# Unix-style newlines with a newline ending every file. | ||
end_of_line = LF | ||
insert_final_newline = true | ||
|
||
[*.php] | ||
indent_size = 4 | ||
|
||
[*.yml] | ||
indent_size = 2 |
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,16 @@ | ||
module.exports = { | ||
extends: '@studiometa/eslint-config/prettier-es6', | ||
rules: { | ||
'global-require': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: 'readme.md', | ||
rules: { | ||
'no-undef': 'off', | ||
'no-unused-vars': 'off', | ||
'import/no-unresolved': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
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,11 @@ | ||
# OS et IDE files | ||
.DS_Store | ||
.idea/ | ||
*.sublime-projet | ||
*.sublime-workspace | ||
node_modules/ | ||
npm-debug.log | ||
yarn.lock | ||
.deploys | ||
backup/ | ||
*.ini |
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 @@ | ||
module.exports = require('@studiometa/prettier-config'); |
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,134 @@ | ||
"use strict"; | ||
|
||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "findEntries", { | ||
enumerable: true, | ||
get: function get() { | ||
return _findEntries["default"]; | ||
} | ||
}); | ||
exports["default"] = exports.mergeConfig = exports.defaultConfig = void 0; | ||
|
||
var _webpackMerge = _interopRequireDefault(require("webpack-merge")); | ||
|
||
var _plugin = _interopRequireDefault(require("vue-loader/lib/plugin")); | ||
|
||
var _findEntries = _interopRequireDefault(require("./utils/find-entries")); | ||
|
||
var defaultConfig = { | ||
mode: 'production', | ||
cache: true, | ||
devtool: 'source-map', | ||
target: 'web', | ||
output: { | ||
pathinfo: false, | ||
filename: '[name].js', | ||
chunkFilename: 'chunk/[name].js', | ||
sourceMapFilename: 'maps/[file].map' | ||
}, | ||
module: { | ||
rules: [{ | ||
test: /\.m?js$/, | ||
type: 'javascript/auto', | ||
exclude: /(node_modules)/, | ||
use: [{ | ||
loader: 'babel-loader', | ||
options: { | ||
sourceMap: true, | ||
cacheDirectory: true | ||
} | ||
}] | ||
}, { | ||
test: /\.vue$/, | ||
use: ['vue-loader'] | ||
}, { | ||
test: /\.s?css$/, | ||
use: ['style-loader', { | ||
loader: 'css-loader', | ||
options: { | ||
sourceMap: false | ||
} | ||
}, { | ||
loader: 'postcss-loader', | ||
options: { | ||
sourceMap: false, | ||
plugins: [require('autoprefixer')(), require('cssnano')()] | ||
} | ||
}, { | ||
loader: 'resolve-url-loader', | ||
options: { | ||
sourceMap: false | ||
} | ||
}, { | ||
loader: 'sass-loader', | ||
options: { | ||
sourceMap: false, | ||
implementation: require('sass') | ||
} | ||
}] | ||
}] | ||
}, | ||
stats: { | ||
all: false, | ||
assets: true, | ||
cached: true, | ||
colors: true, | ||
errorDetails: true, | ||
errors: true, | ||
maxModules: 0, | ||
modules: true, | ||
moduleTrace: true, | ||
performance: true, | ||
timings: true, | ||
warnings: true, | ||
excludeAssets: /\.map$/ | ||
}, | ||
resolve: { | ||
extensions: ['.vue', '.mjs', '.js', '.json'] | ||
}, | ||
plugins: [new _plugin["default"]()], | ||
optimization: { | ||
checkWasmTypes: true, | ||
concatenateModules: true, | ||
flagIncludedChunks: true, | ||
minimize: true, | ||
minimizer: [function (compiler) { | ||
var MinifyPlugin = require('babel-minify-webpack-plugin'); | ||
|
||
return new MinifyPlugin({}, { | ||
sourceMap: true | ||
}).apply(compiler); | ||
}], | ||
namedChunks: false, | ||
namedModules: false, | ||
nodeEnv: 'production', | ||
noEmitOnErrors: true, | ||
occurrenceOrder: true, | ||
sideEffects: true, | ||
usedExports: true, | ||
splitChunks: { | ||
hidePathInfo: true, | ||
chunks: 'async', | ||
minSize: 100000, | ||
maxSize: 0, | ||
minChunks: 1, | ||
maxAsyncRequests: 5, | ||
maxInitialRequests: 3, | ||
automaticNameDelimiter: '~', | ||
name: true | ||
} | ||
} | ||
}; | ||
exports.defaultConfig = defaultConfig; | ||
|
||
var mergeConfig = function mergeConfig(webpackConfig) { | ||
return (0, _webpackMerge["default"])(defaultConfig, webpackConfig); | ||
}; | ||
|
||
exports.mergeConfig = mergeConfig; | ||
var _default = defaultConfig; | ||
exports["default"] = _default; |
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,85 @@ | ||
"use strict"; | ||
|
||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = findEntriesByGlobs; | ||
|
||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
|
||
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); | ||
|
||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
|
||
var _glob = require("glob"); | ||
|
||
var _path = require("path"); | ||
|
||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
|
||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
|
||
/** | ||
* Generate an object of entries from a given glob and current workin directory | ||
* @param {String} glob The glob of files to find | ||
* @param {String} cwd The source path of the files | ||
* @param {Object} options Options passed to the globSync method | ||
* @return {Object} An object of entries | ||
*/ | ||
function findEntriesByGlob(glob, cwd) { | ||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
return (0, _glob.sync)(glob, _objectSpread({}, options, { | ||
cwd: cwd | ||
})).reduce(function (entries, filepath) { | ||
var ext = (0, _path.extname)(filepath).replace(/^\./, ''); | ||
var regexp = new RegExp("\\.".concat(ext, "$")); | ||
var entryName = filepath.replace("".concat(cwd, "/"), '').replace(regexp, ''); | ||
entries[entryName] = (0, _path.resolve)((0, _path.join)(cwd, filepath)); | ||
return entries; | ||
}, {}); | ||
} | ||
/** | ||
* Generate an object of entries from the given globs | ||
* @param {String|Array} glob The glob of files to find | ||
* @param {String} cwd The source path of the files | ||
* @param {Object} options Options passed to the globSync method | ||
* @return {Object} An object of entries | ||
*/ | ||
|
||
|
||
function findEntriesByGlobs(glob, cwd) { | ||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
|
||
if (Array.isArray(glob)) { | ||
var negatives = []; | ||
var allEntries = {}; | ||
glob.forEach(function (singleGlob) { | ||
var isNegative = singleGlob.startsWith('!'); | ||
var absoluteGlob = isNegative ? singleGlob.substring(1) : singleGlob; | ||
var entries = findEntriesByGlob(absoluteGlob, cwd, options); | ||
|
||
if (isNegative) { | ||
negatives.push.apply(negatives, (0, _toConsumableArray2["default"])(Object.keys(entries))); | ||
} | ||
|
||
allEntries = _objectSpread({}, allEntries, {}, entries); | ||
}); // Filter out all negatives matches before returning | ||
|
||
return Object.entries(allEntries).reduce(function (entries, _ref) { | ||
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), | ||
key = _ref2[0], | ||
path = _ref2[1]; | ||
|
||
if (negatives.includes(key)) { | ||
return entries; | ||
} | ||
|
||
entries[key] = path; | ||
return entries; | ||
}, {}); | ||
} | ||
|
||
return findEntriesByGlob(glob, cwd, options); | ||
} |
Oops, something went wrong.