forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add webpack, webpack-rails, and webpack-dev-server along with a simpl…
…e hello world test Add the following line to GDK Procfile to play with it: webpack: exec support/exec-cd gitlab npm run dev-server
- Loading branch information
1 parent
57652bf
commit 4c5ff1d
Showing
10 changed files
with
70 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/builds/ | ||
/coverage/ | ||
/coverage-javascript/ | ||
/node_modules/ | ||
/public/ | ||
/tmp/ | ||
/vendor/ | ||
/builds/ | ||
webpack.config.js |
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
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 @@ | ||
require('./hello_world'); |
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,3 @@ | ||
/* eslint-disable no-console */ | ||
|
||
console.log('hello world!'); |
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,46 @@ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var StatsPlugin = require('stats-webpack-plugin'); | ||
|
||
var IS_PRODUCTION = process.env.NODE_ENV === 'production'; | ||
var ROOT_PATH = path.resolve(__dirname, '..'); | ||
|
||
// must match config.webpack.dev_server.port | ||
var DEV_SERVER_PORT = 3808; | ||
|
||
var config = { | ||
context: ROOT_PATH, | ||
entry: { | ||
bundle: './app/assets/javascripts/webpack/bundle.js' | ||
}, | ||
|
||
output: { | ||
path: path.join(ROOT_PATH, 'public/assets/webpack'), | ||
publicPath: '/assets/webpack/', | ||
filename: IS_PRODUCTION ? '[name]-[chunkhash].js' : '[name].js' | ||
}, | ||
|
||
plugins: [ | ||
// manifest filename must match config.webpack.manifest_filename | ||
// webpack-rails only needs assetsByChunkName to function properly | ||
new StatsPlugin('manifest.json', { | ||
chunkModules: false, | ||
source: false, | ||
chunks: false, | ||
modules: false, | ||
assets: true | ||
}) | ||
] | ||
} | ||
|
||
if (!IS_PRODUCTION) { | ||
config.devServer = { | ||
port: DEV_SERVER_PORT, | ||
headers: { 'Access-Control-Allow-Origin': '*' } | ||
}; | ||
config.output.publicPath = '//localhost:' + DEV_SERVER_PORT + config.output.publicPath; | ||
} | ||
|
||
module.exports = 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