Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
fix: Cannot get array element raw (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
IniZio authored Jan 29, 2018
1 parent 9899c35 commit 04e51cf
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 4 deletions.
85 changes: 85 additions & 0 deletions packages/clipped/clipped.config.1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
const glob = require('glob')
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const nodeExternals = require('webpack-node-externals')

module.exports = async clipped => {
await clipped.use(require('clip-webpack-nodejs'))

clipped.config.webpack
.mark()
.resolve
.set('symlinks', true)
.back()
.resolveLoader
.set('symlinks', true)
.back()
.set('externals', [
nodeExternals({
modulesFromFile: true,
whitelist: [/^webpack/]
})
])

console.log(clipped.config.webpack.plugins.toJSON())

clipped.config.webpack
.plugins
.banner
.args
.

clipped.config.webpack
.plugin('banner')
.tap(args => {
args[0].banner = `require('source-map-support/register')`
return args
})

clipped.config.webpack.module
.rule('shebang')
.test( /node_modules[/\\]jsonstream/i)
.use('shebang').loader(require.resolve('shebang-loader')).end()

clipped.config.webpack
.plugin('ignore-electron')
.use(webpack.IgnorePlugin, [/^electron$/])

clipped.config.webpack.resolve.modules
.add('node_modules')
clipped.config.webpack.resolveLoader.modules
.add('node_modules')

clipped.config.webpack.module
.rule('rx')
.test(/rx\.lite\.aggregates\.js/)
.use('import').loader(`${require.resolve('imports-loader')}?define=>false`).end()

// Compile for testing
clipped.config.webpack.when(process.env.NODE_ENV === 'test', config => {
config.entry('index')
.clear()
.end()

config.output
.path(clipped.resolve('test-dist'))

for (let entry of glob.sync('./test/**/*.test.js')) {
config.entry('index')
.add(entry)
.end()
}

config.module
.rule('babel')
.test(/\.js$/)
.include
.add(clipped.resolve('test'))
})

clipped.hook('pre-test')
.add('build', clipped => clipped.execHook('build'))
clipped.hook('test')
.add('placeholder', clipped => {})
}
2 changes: 1 addition & 1 deletion packages/clipped/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"fs-extra": "^5.0.0",
"generator-clipped-base": "^0.1.3",
"git-url-parse": "^7.0.1",
"jointed": "1.5.2",
"jointed": "1.5.3",
"lodash": "^4.17.4",
"mem-fs": "^1.1.3",
"mem-fs-editor": "^3.0.2",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4885,9 +4885,9 @@ joi@^6.4.x:
moment "2.x.x"
topo "1.x.x"

jointed@1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/jointed/-/jointed-1.5.1.tgz#c27d9ab6ababee2684178970a2dfed148a4c5171"
jointed@1.5.3:
version "1.5.3"
resolved "https://registry.yarnpkg.com/jointed/-/jointed-1.5.3.tgz#9b4619eb3d2bf75fa8cc7ea221e29b2f88466a04"
dependencies:
deepmerge "^2.0.1"
lodash "^4.17.4"
Expand Down

0 comments on commit 04e51cf

Please sign in to comment.