Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
, getPackageRoot = function (parents, pkg) {
var dirs = [ 'node_modules' ]
pkg = cleanName(pkg)
if (!isPath(pkg)) { // not a directory reference of some kind
parents.forEach(function (p) {
dirs.push(p)
dirs.push(dirs[0])
})
return path.resolve(path.join.apply(null, dirs), pkg)
}
return path.resolve(pkg)
}
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
},
// Copy redirects file
{
from: path.resolve(__dirname, '../_redirects'),
to: config.build.assetsRoot,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'public',
assetsPublicPath: '/',
productionSourceMap: true,
productionGzip: false,
productionGzipExtensions: ['js', 'css']
},
dev: {
env: require('./dev.env'),
port: 8020,
proxyTable: {
}
}
}
browsers: ['last 2 versions'] // https://browserl.ist/?q=last+2+version
})
]
}
}
module.exports = {
name: 'client',
target: 'web',
entry: {
app: ['@babel/polyfill', './src/client/index.js']
},
output: {
path: path.resolve(__dirname, '../../dist/client'),
filename: devMode ? '[name].bundle.js' : '[name].[hash].js',
publicPath: config.public_path + '/'
},
resolve: {
alias: {
'@': path.resolve('src'),
Config: path.resolve('config/index')
}
},
resolveLoader: {
moduleExtensions: ['-loader']
},
optimization: {
function setup () {
rimraf.sync(path.resolve(salad, 'node_modules'))
rimraf.sync(path.resolve(salad, 'package-lock.json'))
rimraf.sync(path.resolve(bowl, 'node_modules'))
rimraf.sync(path.resolve(bowl, 'package-lock.json'))
rimraf.sync(path.resolve(apple, 'node_modules'))
rimraf.sync(path.resolve(apple, 'package-lock.json'))
rimraf.sync(path.resolve(banana, 'node_modules'))
rimraf.sync(path.resolve(banana, 'package-lock.json'))
rimraf.sync(path.resolve(almond, 'node_modules'))
rimraf.sync(path.resolve(almond, 'package-lock.json'))
}
function resolve(file, parent) {
const root = parent ? path.dirname(parent) : __dirname;
return path.resolve(root, file.slice(-5) === '.walt' ? file : file + '.walt');
}
options (opts) {
if (!config.basedir) {
config.basedir = dirname(resolve(opts.entry || './'))
}
},
module.exports = ({actions, stage}) => {
let module = {};
if (stage === 'build-html') {
module = {
rules: [
{
test: [
path.resolve(__dirname, '../node_modules/wowjs'),
path.resolve(__dirname, '../node_modules/metal-clipboard')
],
loader: 'null-loader',
},
],
};
}
actions.setWebpackConfig({
module,
resolve: {
modules: [path.resolve(__dirname, 'src'), 'node_modules'],
alias: {
$components: path.resolve(__dirname, '../src/components'),
},
},
});
proto.usage = function usage () {
var str = [
'',
' Usage: node-pre-gyp [options]',
'',
' where is one of:',
commands.map(function (c) {
return ' - ' + c + ' - ' + require('./' + c).usage;
}).join('\n'),
'',
'node-pre-gyp@' + this.version + ' ' + path.resolve(__dirname, '..'),
'node@' + process.versions.node
].join('\n');
return str;
};
return files.filter(filepath => {
const normalized = path.normalize(filepath)
const fullpath = path.resolve(root, normalized)
const hash = digest(fs.readFileSync(fullpath, 'utf-8'))
const found = _.get(normalized, cache)
return found && hash !== found.hash
})
}